Skip to main content

A plugin for MkDocs to generate API documentation

Project description

astdoc

PyPI Version Python Version Build Status Coverage Status

astdoc is a plugin for MkDocs, designed to facilitate the generation of API documentation for Python projects. astdoc 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.

astdoc 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.

astdoc 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.

astdoc 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 astdoc plugin using pip:

pip install astdoc

astdoc requires the following dependencies:

  • Python 3.10 or higher
  • MkDocs 1.6 or higher

Configuration

To configure astdoc, add the following lines to your mkdocs.yml file:

plugins:
  - astdoc

Usage

astdoc 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


Download files

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

Source Distribution

astdoc-0.0.1.tar.gz (85.3 kB view details)

Uploaded Source

Built Distribution

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

astdoc-0.0.1-py3-none-any.whl (66.2 kB view details)

Uploaded Python 3

File details

Details for the file astdoc-0.0.1.tar.gz.

File metadata

  • Download URL: astdoc-0.0.1.tar.gz
  • Upload date:
  • Size: 85.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.24

File hashes

Hashes for astdoc-0.0.1.tar.gz
Algorithm Hash digest
SHA256 594dadb29737e38346b5e682f0c039ed9753e00719fd272eb4ba2c60c55041f8
MD5 864106d2283bfd5d0e4ccb54b70e7d91
BLAKE2b-256 ab99b0d7fe17b55d8a2cdf5d10f983115117bd30c46dfbde114f07989bac7a14

See more details on using hashes here.

File details

Details for the file astdoc-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: astdoc-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 66.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.24

File hashes

Hashes for astdoc-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b6704d0ad53faf2a30e42f6de7abaebe88f7da65afbebd1a6a56ef0c4ed11043
MD5 e4805062287175230d906c7617ee7eb2
BLAKE2b-256 96ed20c04cbbfd1a830271533f463b8584ebcdf32e503ecd8c1eea30429f8ed7

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