mkdocs-autoapi


Namemkdocs-autoapi JSON
Version 0.3.2 PyPI version JSON
download
home_pageNone
SummaryMkDocs plugin providing automatic API reference generation
upload_time2024-11-01 13:06:20
maintainerNone
docs_urlNone
authorNone
requires_python>=3.6
licenseNone
keywords mkdocs documentation api autoapi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # mkdocs-autoapi

[![pypi version](https://img.shields.io/pypi/v/mkdocs-autoapi.svg)](https://pypi.org/project/mkdocs-autoapi/)
[![docs](https://readthedocs.org/projects/mkdocs-autoapi/badge/?version=latest)](https://mkdocs-autoapi.readthedocs.io/en/latest/)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)


## 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](https://mkdocstrings.github.io/recipes/#automatic-code-reference-pages)
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`:

```bash
pip install mkdocs-autoapi
```

## Usage

### Basic Usage

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

```yaml
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 `autoapi_dir` configuration option:

```yaml
plugins:
  - ... other plugin configuration ...
  - mkdocs-autoapi:
      autoapi_dir: /path/to/autoapi/dir
  - mkdocstrings
```

### Including and Ignoring Patterns

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

* `**/.venv/**/`
* `**/venv/**/`

Likewise, the `autoapi_file_patterns` configuration option allows for control of
which files are included in the API reference. This option also accepts a list
of glob patterns which are evaluated (recursively) relative to `autoapi_dir`. By
default, all files with `.py` and `.pyi` extensions are included.

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

```tree
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 ignore all files named `lorem.py`, you can add the following configuration
to your `mkdocs.yml` file:

```yaml
plugins:
  - ... other plugin configuration ...
  - mkdocs-autoapi:
      autoapi_ignore:
        - "**/lorem.py"
      autoapi_file_patterns:
        - "*.py"
  - mkdocstrings
```

## Disabling API Documentation Generation

To disable API documentation generation, set the `autoapi_generate_api_docs`
configuration option to `False`. This is useful when transitioning to manual
documentation or when the API documentation is not needed.

## Including API Documentation in Navigation

The inclusion of API documentation in the navigation can be controlled via the
configuration option `autoapi_add_nav_entry`. This option accepts either a
boolean value or a string. Behavior is as follows:

* If `True`, then a section named "API Reference" will be added to the end of
the navigation.
* If `False`, then no section for the API documentation will be added. In this
case, a manual link to the API documentation can be added to the navigation.
* If a string, then a section with the specified name will be added to the end
of the navigation.

Example: To include the API documentation in the navigation under the section
"Reference", add the following configuration to `mkdocs.yml`:

```yaml
plugins:
  - ... other plugin configuration ...
  - mkdocs-autoapi:
      autoapi_add_nav_entry: Reference
  - mkdocstrings
```

Example: To disable the automatic addition of the API documentation to the
navigation and add a manual link to the API documentation, add the following
configuration to `mkdocs.yml`:

```yaml
nav:
  - ... other navigation configuration ...
  - API: autoapi/ # target should be `autoapi_root`
  - ... other navigation configuration ...
```

More information on navigation configuration can be found in the
[MkDocs User Guide](https://www.mkdocs.org/user-guide/configuration/#nav).

### Putting It All Together

Again, consider the following project structure:

```tree
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
```

A full `mkdocs.yml` for the project might look like this:

```yaml mkdocs.yml
site_name: Project

nav:
  - Home: index.md
  - API Reference: autoapi/

plugins:
  - mkdocs-autoapi
  - mkdocstrings

theme:
  name: readthedocs
```

More information MkDocs configuration through `mkdocs.yml` can be found in the
[MkDocs User Guide](https://www.mkdocs.org/user-guide/configuration/).

## 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](https://github.com/jcayers20/mkdocs-autoapi/blob/main/LICENSE) file
for more information.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mkdocs-autoapi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "mkdocs, documentation, api, autoapi",
    "author": null,
    "author_email": "Jacob Ayers <jcayers20@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/b7/02/1d53f651b4692dba8a0003a95c5373f0948e778c9563d6df56c871fd8c0a/mkdocs_autoapi-0.3.2.tar.gz",
    "platform": null,
    "description": "# mkdocs-autoapi\n\n[![pypi version](https://img.shields.io/pypi/v/mkdocs-autoapi.svg)](https://pypi.org/project/mkdocs-autoapi/)\n[![docs](https://readthedocs.org/projects/mkdocs-autoapi/badge/?version=latest)](https://mkdocs-autoapi.readthedocs.io/en/latest/)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n\n\n## Description\n\n`mkdocs-autoapi` is a MkDocs plugin that automatically generates API\ndocumentation from your project's source code. The idea for the plugin comes\nfrom this [recipe](https://mkdocstrings.github.io/recipes/#automatic-code-reference-pages)\nin the MkDocs documentation.\n\n## Installation\n\n### Requirements\n\n* Python version 3.6 or higher\n* MkDocs version 1.4.0 or higher\n* mkdocstrings version 0.19.0 or higher\n\n### Installation via `pip`\n\nWe recommend installing this package with `pip`:\n\n```bash\npip install mkdocs-autoapi\n```\n\n## Usage\n\n### Basic Usage\n\nTo use the plugin, add the following configuration to your `mkdocs.yml` file:\n\n```yaml\nplugins:\n  - ... other plugin configuration ...\n  - mkdocs-autoapi\n  - mkdocstrings\n```\n\n### Setting the Project Root\n\nBy default, the plugin will use the current working directory as the project\nroot. If you would like to use a different directory, you can specify a value\nin the `autoapi_dir` configuration option:\n\n```yaml\nplugins:\n  - ... other plugin configuration ...\n  - mkdocs-autoapi:\n      autoapi_dir: /path/to/autoapi/dir\n  - mkdocstrings\n```\n\n### Including and Ignoring Patterns\n\nYou can ignore files and directories from the documentation by specifying a\nvalue in the `autoapi_ignore` configuration option. This option accepts a list\nof glob patterns. Note that the following patterns are always ignored:\n\n* `**/.venv/**/`\n* `**/venv/**/`\n\nLikewise, the `autoapi_file_patterns` configuration option allows for control of\nwhich files are included in the API reference. This option also accepts a list\nof glob patterns which are evaluated (recursively) relative to `autoapi_dir`. By\ndefault, all files with `.py` and `.pyi` extensions are included.\n\nAs an example, suppose your project has the following structure:\n\n```tree\nproject/\n    docs/\n        index.md\n    module/\n        __init__.py\n        lorem.py\n        ipsum.py\n        dolor.py\n    second_module/\n        __init__.py\n        lorem.py\n        sit.py\n        amet.py\n    venv/\n    mkdocs.yml\n    README.md\n```\n\nTo ignore all files named `lorem.py`, you can add the following configuration\nto your `mkdocs.yml` file:\n\n```yaml\nplugins:\n  - ... other plugin configuration ...\n  - mkdocs-autoapi:\n      autoapi_ignore:\n        - \"**/lorem.py\"\n      autoapi_file_patterns:\n        - \"*.py\"\n  - mkdocstrings\n```\n\n## Disabling API Documentation Generation\n\nTo disable API documentation generation, set the `autoapi_generate_api_docs`\nconfiguration option to `False`. This is useful when transitioning to manual\ndocumentation or when the API documentation is not needed.\n\n## Including API Documentation in Navigation\n\nThe inclusion of API documentation in the navigation can be controlled via the\nconfiguration option `autoapi_add_nav_entry`. This option accepts either a\nboolean value or a string. Behavior is as follows:\n\n* If `True`, then a section named \"API Reference\" will be added to the end of\nthe navigation.\n* If `False`, then no section for the API documentation will be added. In this\ncase, a manual link to the API documentation can be added to the navigation.\n* If a string, then a section with the specified name will be added to the end\nof the navigation.\n\nExample: To include the API documentation in the navigation under the section\n\"Reference\", add the following configuration to `mkdocs.yml`:\n\n```yaml\nplugins:\n  - ... other plugin configuration ...\n  - mkdocs-autoapi:\n      autoapi_add_nav_entry: Reference\n  - mkdocstrings\n```\n\nExample: To disable the automatic addition of the API documentation to the\nnavigation and add a manual link to the API documentation, add the following\nconfiguration to `mkdocs.yml`:\n\n```yaml\nnav:\n  - ... other navigation configuration ...\n  - API: autoapi/ # target should be `autoapi_root`\n  - ... other navigation configuration ...\n```\n\nMore information on navigation configuration can be found in the\n[MkDocs User Guide](https://www.mkdocs.org/user-guide/configuration/#nav).\n\n### Putting It All Together\n\nAgain, consider the following project structure:\n\n```tree\nproject/\n    docs/\n        index.md\n    module/\n        __init__.py\n        lorem.py\n        ipsum.py\n        dolor.py\n    second_module/\n        __init__.py\n        lorem.py\n        sit.py\n        amet.py\n    venv/\n    mkdocs.yml\n    README.md\n```\n\nA full `mkdocs.yml` for the project might look like this:\n\n```yaml mkdocs.yml\nsite_name: Project\n\nnav:\n  - Home: index.md\n  - API Reference: autoapi/\n\nplugins:\n  - mkdocs-autoapi\n  - mkdocstrings\n\ntheme:\n  name: readthedocs\n```\n\nMore information MkDocs configuration through `mkdocs.yml` can be found in the\n[MkDocs User Guide](https://www.mkdocs.org/user-guide/configuration/).\n\n## Contributing\n\nContributions are always welcome! Please submit a pull request or open an issue\nto get started.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](https://github.com/jcayers20/mkdocs-autoapi/blob/main/LICENSE) file\nfor more information.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "MkDocs plugin providing automatic API reference generation",
    "version": "0.3.2",
    "project_urls": {
        "Changelog": "https://github.com/jcayers20/mkdocs-autoapi/blob/main/CHANGELOG.md",
        "Documentation": "https://mkdocs-autoapi.readthedocs.io/en/0.2.1/",
        "Issues": "https://github.com/jcayers20/mkdocs-autoapi/issues",
        "License": "https://github.com/jcayers20/mkdocs-autoapi/blob/main/LICENSE",
        "Repository": "https://github.com/jcayers20/mkdocs-autoapi"
    },
    "split_keywords": [
        "mkdocs",
        " documentation",
        " api",
        " autoapi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4d3d804015da1985c15a8c1bfa7d67652ffa8d9628eaf401a80ab039ef4af9b5",
                "md5": "5b155846cc248216e0fc783b7b174f2e",
                "sha256": "5bad09a92b9e20e43765cb007fc7f04f4473878c93b37be0d4b450a0822e65f8"
            },
            "downloads": -1,
            "filename": "mkdocs_autoapi-0.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5b155846cc248216e0fc783b7b174f2e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 23984,
            "upload_time": "2024-11-01T13:06:18",
            "upload_time_iso_8601": "2024-11-01T13:06:18.430609Z",
            "url": "https://files.pythonhosted.org/packages/4d/3d/804015da1985c15a8c1bfa7d67652ffa8d9628eaf401a80ab039ef4af9b5/mkdocs_autoapi-0.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b7021d53f651b4692dba8a0003a95c5373f0948e778c9563d6df56c871fd8c0a",
                "md5": "e66d2761e047fb1c41844061b06e4e7b",
                "sha256": "c00b88254a37ef788fa126c2578ad1dc1ac20ffd1e3edc379bd4d7335d221488"
            },
            "downloads": -1,
            "filename": "mkdocs_autoapi-0.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e66d2761e047fb1c41844061b06e4e7b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 21599,
            "upload_time": "2024-11-01T13:06:20",
            "upload_time_iso_8601": "2024-11-01T13:06:20.035966Z",
            "url": "https://files.pythonhosted.org/packages/b7/02/1d53f651b4692dba8a0003a95c5373f0948e778c9563d6df56c871fd8c0a/mkdocs_autoapi-0.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-01 13:06:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jcayers20",
    "github_project": "mkdocs-autoapi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "mkdocs-autoapi"
}
        
Elapsed time: 0.71951s