Inject Sphinx Configuration from pyproject.toml
Project description
sphinx-autopyproject
Move as much Sphinx configuration as possible from conf.py
to pyproject.toml
! Might even be ... everything
(If you are interested in more automatically generated API documentation, check out sphinx-automagicdoc
as well.)
Usage
Either run spinx-autopyproject-build
to run sphinx-build
without the need for a conf.py
to exist,
or if you want to use a conf.py
, add the line:
from sphinx_autopyproject.auto import *
To configure, set the [tool.sphinx-autopyproject]
section:
[tool.sphinx-autopyproject]
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx_rtd_theme",
]
language = "en"
source_suffix = ['.rst']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
html_theme = "sphinx_rtd_theme"
The [tool.sphinx-autopyproject.autopyproject]
section is to configure sphinx-autopyproject
if desired.
Supported is the dynamic
subsection, which allows to automatically fetch configuration values from other sources,
such as the package metadata. Multiple dynamic fetchers are supported: for type="package"
, the local package will be built (using build
), for type="token"
, a variable assignment will be searched via plain file reading (e.g. to extract __version__
), or for type="python"
, the given package/variable will be imported via Python.
[tool.sphinx-autopyproject.autopyproject.dynamic]
project = { type="package", value="name"}
copyright = { type="package", value="author"}
author = { type="package", value="author"}
version = { type="package", value="version"}
The sys_path
list can be used to add directories to sys.path
.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sphinx-autopyproject-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36bd6458d718713a02b99e448e97a740a27448945983fdb177da2ac2b48455a1 |
|
MD5 | 964b5599a05b72d5daf64679f46e4d15 |
|
BLAKE2b-256 | 0f2be510cf08bfa47ae4605267ba218c96fa9219a5660d61093e6f7418bf775f |
Hashes for sphinx_autopyproject-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f40e43a8e09b0940f9f9acb7053abd5803404d0117e0782d088e8b0c7c61b48 |
|
MD5 | 4ef349ef527180599ab94e9508f7983a |
|
BLAKE2b-256 | 2b47b6bf632d23f4ef44f0e3e006e4919fc85403aaadf7fc2cf95b13dd1c7ef1 |