Skip to main content

MkDocs plugin providing automatic API reference generation

Project description

mkdocs-autoapi

Description

mkdocs-autoapi is a MkDocs plugin that automatically generates API documentation from your project's source code. The idea for the plugin comes from this recipe in the MkDocs documentation.

Installation

Requirements

  • Python version 3.6 or higher
  • MkDocs version 1.4.0 or higher
  • mkdocstrings version 0.19.0 or higher

Installation via pip

We recommend installing this package with pip:

pip install mkdocs-autoapi

Usage

Basic Usage

To use the plugin, add the following configuration to your mkdocs.yml file:

plugins:
  - ... other plugin configuration ...
  - mkdocs-autoapi
  - mkdocstrings

Setting the Project Root

By default, the plugin will use the current working directory as the project root. If you would like to use a different directory, you can specify a value in the project_root configuration option:

plugins:
  - ... other plugin configuration ...
  - mkdocs-autoapi:
      project_root: /path/to/project/root
  - mkdocstrings

Excluding Patterns

You can exclude files and directories from the documentation by specifying a value in the exclude configuration option. This option accepts a list of glob patterns. Note that the following patterns are always excluded:

  • **/.venv/**/
  • **/venv/**/

As an example, suppose your project has the following structure:

project/
    docs/
        index.md
    module/
        __init__.py
        lorem.py
        ipsum.py
        dolor.py
    second_module/
        __init__.py
        lorem.py
        sit.py
        amet.py
    venv/
    mkdocs.yml
    README.md

To exclude all files named lorem.py, you can add the following configuration to your mkdocs.yml file:

plugins:
  - ... other plugin configuration ...
  - mkdocs-autoapi:
      exclude:
        - "**/lorem.py"
  - mkdocstrings

Contributing

Contributions are always welcome! Please submit a pull request or open an issue to get started.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

Project details


Download files

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

Source Distribution

mkdocs_autoapi-0.1.6.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

mkdocs_autoapi-0.1.6-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_autoapi-0.1.6.tar.gz.

File metadata

  • Download URL: mkdocs_autoapi-0.1.6.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.6

File hashes

Hashes for mkdocs_autoapi-0.1.6.tar.gz
Algorithm Hash digest
SHA256 fb058f8139a43ff3abf03136ef8d21b6a3b8eac55d947890a8ede9aee449ffef
MD5 055121e0bde9e2244b5cbff678a160b4
BLAKE2b-256 2a06ae9efceee0e9aa2854dc3cc2f07e351376b6730ba93eade37f8ddf1d14fc

See more details on using hashes here.

File details

Details for the file mkdocs_autoapi-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_autoapi-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8cb2aa1f8bfaa2d2d66a54aad73b9bca5ded5ef51f83ae4da364a9e6a7c80fe5
MD5 8707c81ee29f064ca0c216f8bcaa6ddb
BLAKE2b-256 f63c352704e450b084722fea4afb9b62b29afb96db39177ee5160d0efe31f727

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