Skip to main content

Manage sphinx documentations with mkdocs

Project description

PyPI version

About

mkinx allows you to integrate several sphinx documentation projects into one Home Documentation listing them and allowing you to have cross projects documentation with mkdocs.

Any sphinx module can be used as long as make html works and the built code is in your_project/build.

mkinx comes with an example project and a standalone documention so you can already get started!

Default settings are that the Home Documentation will use a Material Design theme and Project Documentations will use Read The Docs’s theme, to better distinguish the hierarchy. You can change that (in respectively mkdocs.yml and conf.py).

Install

pip install mkinx

Getting Started

Start your Home Documentation with:

mkinx init your_project

Start the server with

mkinx serve

Optionnaly you can specify a port with mkinx serve -s your_port

Build the documentation with

mkinx build [FLAGS]

Flags being:

-v, --verbose                             verbose flag (Sphinx will stay verbose)
-A, --all                                 Build doc for all projects
-F, --force                               force the build, no verification asked
-o, --only_index                          only build projects listed in the Documentation's Home
-p, --projects [PROJECTS [PROJECTS ...]]  list of projects to build

Usage

The package comes with a thorough documentation by default, which you’ll see by running mkinx serve after a proper init. A Read The Docs-hosted version may arrive at some point.

The built in documentation is there to help you but is in no way necessary, you can overwrite or delete everything. There are however 2 mandatory things:

1 You have to keep this structure:

your_home_documentation/
    mkdocs.yml
    docs/ # your home documentation, listing sphinx docs
        index.md # mandatory file -> mkdocs's index
    site/
    your_project_1/
        build/ # sphinx's build directory
        source/ # sphinx's documentation source directory
        your_package_1_1/
        your_package_1_2/
        ...
    your_project_2/
        build/
        source/
        your_package_2_1/
        your_package_2_2/
        ...
    ...

2 mkdocs’s index.md file must have a # Projects section listing them as in the example

Also, remember to run build or serve commands from your Home Documenation’s root folder (in your_home_documentation/ in the example above) otherwise you may get errors saying mkinx can’t find a file.

Adding a Python project

mkinx comes with a useful autodoc command helping you easily add a new python project to your documentation.

All you have to do is put the documented (Google-style docstrings) code along the documentation in your_home_documentation/. Say it’s called your_project_3. Then you just need to go there and use autodoc:

$ cp -r path/to/your_project_3 path/to/doc/your_home_documentation/
$ cd your_home_documentation/your_project_3/
$ mkinx autodoc

Under the hood, mkinx autodoc runs sphinx-quickstart, updates default values to be compatible to the mkinx setting, builds the documentation with mkinx build and updated the Home Documentation’s index.md file to list your_project_3.

If mkinx autodoc’s default values for the sphinx documentation don’t suit you, do update your_project_3/conf.py.

Customization

You may use any other theme for instance. To use mkdocs-nature just:

pip install mkdocs-nature

Then change this in mkdocs.yaml : theme: nature and finally:

mkdocs build

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

mkinx-0.2.0.1-py3-none-any.whl (92.9 kB view details)

Uploaded Python 3

File details

Details for the file mkinx-0.2.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mkinx-0.2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 403b6390c771a3b5efa481eda0bc3a7c2d27c24d4a0ed808edfb4e69e841625b
MD5 0db071a0abd2e37acbe9b8d9fe0c52b7
BLAKE2b-256 4744364d6457b8eef1c3bb64af5717ebf257d00781a114cf3bac7134cc825713

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