Sphinx Feature

Usage

To use the Sphinx Feature, make sure your Projectfile contains the following:

from medikit import require

sphinx = require('sphinx')

The sphinx handle is a SphinxConfig instance, and can be used to customize the feature.

You can customize the theme:

sphinx.theme = 'sphinx_rtd_theme'

Note that this should be a parsable requirement, and it won’t be added to your docs/conf.py automatically.

This feature will add the necessary requirements to the python feature (sphinx mostly, and eventually your theme requirement) and setup the correct makefile task to build the html docs. Note that it won’t bootstrap your sphinx config file, and you still need to run the following if your documentation does not exist yet:

$ make update-requirements
$ make install-dev
$ mkdir docs
$ cd docs
$ sphinx-quickstart .

Then, eventually tune the configuration.

Note

In the future, we may consider generating it for you if it does not exist, but it’s not a priority.

Configuration

class medikit.feature.sphinx.SphinxConfig[source]
get_theme()[source]

Gets the theme. Prefer using the .theme property.

Returns:parsed requirement
set_theme(theme)[source]

Sets the theme. Prefer using the .theme property.

Parameters:theme – Requirement for theme
theme

Sphinx theme to use, that should be parsable as a requirement.

Implementation

class medikit.feature.sphinx.SphinxFeature(dispatcher)[source]
Config

alias of SphinxConfig

on_make_generate(event)[source]

Listens to medikit.feature.make.on_generate event (priority: -20)

on_python_generate(event)[source]

Listens to medikit.feature.python.on_generate event (priority: 0)