Skip to main content

Automatic documentation from sources, for MkDocs.

Project description

mkdocstrings

ci documentation pypi version conda version gitpod gitter

Automatic documentation from sources, for MkDocs. Come have a chat or ask questions on our Gitter channel.


Features - Requirements - Installation - Quick usage

mkdocstrings_gif1

Features

  • Language-agnostic: just like MkDocs, mkdocstrings is written in Python but is language-agnostic. It means you can use it with any programming language, as long as there is a handler for it. We currently have handlers for the Crystal and Python languages, as well as for shell scripts/libraries. Maybe you'd like to add another one to the list? :wink:

  • Multiple themes support: each handler can offer multiple themes. Currently, we offer the :star: Material theme :star: as well as basic support for the ReadTheDocs and MkDocs themes for the Python handler.

  • Cross-references across pages: mkdocstrings makes it possible to reference headings in other Markdown files with the classic Markdown linking syntax: [identifier][] or [title][identifier] -- and you don't need to remember which exact page this object was on. This works for any heading that's produced by a mkdocstrings language handler, and you can opt to include any Markdown heading into the global referencing scheme.

    Note: in versions prior to 0.15 all Markdown headers were included, but now you need to opt in.

  • Cross-references across sites: similarly to Sphinx's intersphinx extension, mkdocstrings can reference API items from other libraries, given they provide an inventory and you load that inventory in your MkDocs configuration.

  • Inline injection in Markdown: instead of generating Markdown files, mkdocstrings allows you to inject documentation anywhere in your Markdown contents. The syntax is simple: ::: identifier followed by a 4-spaces indented YAML block. The identifier and YAML configuration will be passed to the appropriate handler to collect and render documentation.

  • Global and local configuration: each handler can be configured globally in mkdocs.yml, and locally for each "autodoc" instruction.

  • Reasonable defaults: you should be able to just drop the plugin in your configuration and enjoy your auto-generated docs.

Used by

mkdocstrings is used by well-known companies, projects and scientific teams: Ansible, Apache, Google, Jitsi, Microsoft, Prefect, Pydantic, and more...

Installation

With pip:

pip install mkdocstrings

You can install support for specific languages using extras, for example:

pip install 'mkdocstrings[crystal,python]'

See the available language handlers.

With conda:

conda install -c conda-forge mkdocstrings

Quick usage

In mkdocs.yml:

site_name: "My Library"

theme:
  name: "material"

plugins:
- search
- mkdocstrings

In one of your markdown files:

# Reference

::: my_library.my_module.my_class

See the Usage section of the docs for more examples!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocstrings-0.24.1.tar.gz (32.0 kB view details)

Uploaded Source

Built Distribution

mkdocstrings-0.24.1-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file mkdocstrings-0.24.1.tar.gz.

File metadata

  • Download URL: mkdocstrings-0.24.1.tar.gz
  • Upload date:
  • Size: 32.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for mkdocstrings-0.24.1.tar.gz
Algorithm Hash digest
SHA256 cc83f9a1c8724fc1be3c2fa071dd73d91ce902ef6a79710249ec8d0ee1064401
MD5 92eaf82db032bc7d5687b3db409624e2
BLAKE2b-256 d8b1ce782ff49d0fcf2ef65e9a77aa651f115a8c5e48aab6a72f2001bfcc404b

See more details on using hashes here.

File details

Details for the file mkdocstrings-0.24.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocstrings-0.24.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b4206f9a2ca8a648e222d5a0ca1d36ba7dee53c88732818de183b536f9042b5d
MD5 0fb9f7ee578d3a6442b2cb9013074634
BLAKE2b-256 d353941fc52aa984f6f03b4f7473d7ec787b22076794eda40701a705cab1ab01

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page