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 to generate API documentation for your Python project.

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

Screenshots

Schemdraw (package tree view & package summary)

schemdraw

Polars (class documentation & link to source code)

polars

Altair (table of contents)

altair

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

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.9.tar.gz (52.7 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.9-py3-none-any.whl (38.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mkapi-2.0.9.tar.gz
Algorithm Hash digest
SHA256 322f23984f12a4c330768c9dfc142d517cb6e0426e8069457c86a74bcaab542e
MD5 b5e7aa15cfcea2c5f168b2d6cde5fc1b
BLAKE2b-256 8f175b056a04d61be6ec5cc16d944a14b287340a30028a38dc6fa6541faddf44

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mkapi-2.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 8576e58e339293c818c0b51440fb147eb0c089e4e0d498825f29ee1e7f0d45cd
MD5 e63c36dd108ed6aca420952d2fe9fc15
BLAKE2b-256 a92952a5d50099eb64434701ec2c0e3602701a0d6f142cfde4d1f35ea1492d83

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