Technical details¶
The sphinx-simplepdf registers the following stuff:
A sphinx builder, called simplepdf. Code inside /builders/simplepdf.py.
A sphinx theme, called sphinx-simplepdf. Files under /themes/sphinx_simplepdf.
During package installation, builder and theme get registered for Sphinx. This is done via the enytry__points
mechanism.
test = ["nox", "pytest", "pytest-xdist", "pytest-cov"]
docs = [
"sphinx-copybutton",
"sphinx-design",
"sphinx-immaterial",
Workflow¶
User calls
make simplepdf.simplepdfbuilder overwrites theme to usesphinx-simplepdf.Builder generates
main.cssfrommain.scssfiles. Injects also config-vars fromsimplepdf_vars.Builder starts a SingleFileHTML based build.
Sphinx creates one single
index.html.Builder manipulates created
index.html:Fixes toc-tree links
Builders starts weasyprint with
index.htmlas inputDone, PDF file exists under
_build/simplepdf.
DEMO project¶
The DEMO project is stored under /demo/ and provides a common way for all developers and users to test everything on a common base.
It can be build by the following steps:
git clone git@github.com:useblocks/sphinx-simplepdf.gitcd sphinx-simplepdfpip install .cd demopip install -r doc-requirements.txtsphinx-build -a -E -b simplepdf . _build/