Skip to main content

A documentation generation tool for MkDocs

Project description

MkAPI

PyPI Version Build Status Coverage Status Python Version

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

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

Features of MkAPI are:

  • 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.2

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.2.tar.gz (48.6 kB view hashes)

Uploaded Source

Built Distribution

mkapi-2.0.2-py3-none-any.whl (36.9 kB view hashes)

Uploaded Python 3

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