Skip to main content

A plugin for MkDocs to generate API documentation

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:
  - 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-3.0.22.tar.gz (86.5 kB view details)

Uploaded Source

Built Distribution

mkapi-3.0.22-py3-none-any.whl (65.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mkapi-3.0.22.tar.gz
  • Upload date:
  • Size: 86.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for mkapi-3.0.22.tar.gz
Algorithm Hash digest
SHA256 722f9751145dd0ce8b3c22613cb3d1aadc19b59568358da0a88c7b85d0279fce
MD5 057b8b17d086bf1fecd9dd7a819f4500
BLAKE2b-256 1ddd78eb1f58fc966131b035c9cb0e4830178eafb449f36dffac23110f54dc5f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mkapi-3.0.22-py3-none-any.whl
  • Upload date:
  • Size: 65.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for mkapi-3.0.22-py3-none-any.whl
Algorithm Hash digest
SHA256 378aef4cb71bf495c7ff4445cdac25642cb15746d99d7d0bc3d4d8ec130140d3
MD5 276b5469faf0f93fcfa27e7875ea6cbc
BLAKE2b-256 8e0ac75ceb161e1214513595a94ed7b7c0f89ee90517da265263f671b13f72aa

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