Skip to main content

A plugin for MkDocs to generate API documentation

Project description

MkAPI

PyPI Version Build Status Coverage Status Python Version

MkAPI is a plugin for MkDocs to generate API documentation for your Python project.

MkAPI supports two styles of docstrings: Google and NumPy. See Napoleon documentation for details.

Features

  • Type annotation: If you write your function such as def func(x: int) -> str:, you don't need write type(s) in Parameters, Returns, or Yields section again. You can override the type annotation in the corresponding docstring.
  • Object type inspection: MkAPI plugin creates class, dataclass, function, method, property prefix for each object.
  • Docstring inheritance: Docstring of a subclass can inherit parameters and attributes description from its superclasses.
  • Table of Contents: Table of contents are inserted into the documentation of each package, module, and class.
  • Bidirectional Link: Bidirectional links are created between documentation and source code.

Installation

Install the MkAPI plugin using pip:

pip install mkapi

Configuration

Add the following lines to mkdocs.yml:

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, attribute, or module.

::: package.module.object

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

Page Mode

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

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

For more details, see Page mode.

Project details


Release history Release notifications | RSS feed

This version

2.0.4

Download files

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

Source Distribution

mkapi-2.0.4.tar.gz (49.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkapi-2.0.4-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mkapi-2.0.4.tar.gz
Algorithm Hash digest
SHA256 d86c3244b518dc89094520c4b4f67beaf831b866754bfebf99cd8a426951a152
MD5 741dcca582f5d37a084f70c874141ee1
BLAKE2b-256 e46604df965b82df9f769788d729f300e5900258883ca5c80b618267ab9e62c9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mkapi-2.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a28fe2a9bafe519cc3f35df987771c6e0093fd5dfef140df4c1ba6a31fc8b6ea
MD5 608e2d635007f80b141dca8c122b29b2
BLAKE2b-256 69a4c380d47e1fa8901d46fcd9a465d6cb71859a2cdc34eb7d7b76a85bbe6b20

See more details on using hashes here.

Supported by

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