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.
'static/js/*.js',
'static/fonts/*.*'
]},
include_package_data=True,
# See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package
entry_points={
'sphinx.html_themes': [
'simplepdf_theme = sphinx_simplepdf.themes.simplepdf_theme',
Workflow¶
User calls
make simplepdf
.simplepdf
builder overwrites theme to usesphinx-simplepdf
.Builder generates
main.css
frommain.scss
files. 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.html
as 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.git
cd sphinx-simplepdf
pip install .
cd demo
pip install -r doc-requirements.txt
sphinx-build -a -E -b simplepdf . _build/