Skip to main content

MkDocs plugin for automatic API documentation generation from Python docstrings

Project description

MkAPI

PyPI Version Python Version Build Status Coverage Status

MkAPI is a plugin for MkDocs, designed to facilitate the generation of API documentation for Python projects. MkAPI streamlines the documentation process by automatically extracting docstrings and organizing them into a structured format, making it easier for developers to maintain and share their API documentation.

MkAPI supports two popular styles of docstrings: Google style and NumPy style, allowing developers to choose the format that best fits their project's needs. See the Napoleon documentation for details about these two styles.

MkAPI is equipped with several key features that enhance the documentation experience:

  • Type Annotation Support: Automatically incorporates type annotations from function definitions into the documentation, reducing redundancy and improving clarity.
  • Object Type Inspection: Analyzes Python objects to determine their types, enabling accurate representation in the documentation.
  • Docstring Inheritance: Supports inheritance of docstring content from parent classes, ensuring that subclasses retain relevant documentation without duplication.
  • Automatic Table of Contents Generation: Generates a table of contents for each package, module, and class, improving navigation within the documentation.
  • Bidirectional Links: Creates links between the documentation and the source code, allowing users to easily navigate between the two.

MkAPI aims to simplify the documentation process, making it more efficient and accessible for developers, while ensuring that the generated documentation is comprehensive and easy to understand.

Installation

Install the MkAPI plugin using pip:

pip install mkapi

MkAPI requires the following dependencies:

  • Python 3.10 or higher
  • MkDocs 1.6 or higher

Configuration

To configure MkAPI, add the following lines to your mkdocs.yml file:

plugins:
  - search
  - mkapi

Usage

MkAPI provides two modes to generate API documentation: Object mode and Page mode.

Object Mode

To generate the API documentation in a Markdown source, add three colons + object full name. The object can be a function, class, or module.

::: package.module.object

The Object mode is useful to embed an object's documentation in an arbitrary position of a Markdown source. For more details, see Object mode.

Page Mode

Using the Page mode, you can construct comprehensive API documentation for your project. You can enable this powerful feature with just one line in mkdocs.yml:

nav:
  - index.md
  - Reference:
    - $api/package.***

For more details, see Page mode.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

mkapi-4.4.3.tar.gz (51.0 kB view details)

Uploaded Source

Built Distribution

mkapi-4.4.3-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

Details for the file mkapi-4.4.3.tar.gz.

File metadata

  • Download URL: mkapi-4.4.3.tar.gz
  • Upload date:
  • Size: 51.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.16

File hashes

Hashes for mkapi-4.4.3.tar.gz
Algorithm Hash digest
SHA256 8b312d06746de302220648604f6a2f490d927a48eeab2fbf8df92c2579bf0928
MD5 da95e650910a225861647183c3a1f1c4
BLAKE2b-256 c973aa7082e1071d8cd974ca8b78899dcd780dbce96684900721f7f0a6d8a249

See more details on using hashes here.

File details

Details for the file mkapi-4.4.3-py3-none-any.whl.

File metadata

  • Download URL: mkapi-4.4.3-py3-none-any.whl
  • Upload date:
  • Size: 28.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.16

File hashes

Hashes for mkapi-4.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bba95d52f4df5d96bbadd20902c7e1609ad0ac09e4dac6b4c56eea375a4de36c
MD5 4436c74ace63fa4a4c73afe4776da1ec
BLAKE2b-256 03bf7172344dc236f3a9240b2d38c0d46d01f9d532dffcf186edd3810b738a10

See more details on using hashes here.

Supported by

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