Use external builders to generate different formats (build.commands
)
Use
zundler
to create the HTMLZip versionUse
SimplePDF
to generate the PDF versionUse regular
sphinx-build -b epub
to build ePUB version
Note
This documentation has the flyout menu integrated even when using build.commands
.
This is because the readthedocs-sphinx-ext
extension was manually installed on purpose.
Read the Docs .readthedocs.yaml
configuration file used to build this docs.
1version: 2
2
3build:
4 os: ubuntu-22.04
5 tools:
6 python: "3"
7 commands:
8 - mkdir --parents _readthedocs/htmlzip _readthedocs/pdf _readthedocs/epub
9 - pip install -r requirements.txt
10 # HTML
11 - sphinx-build -b html docs/ _readthedocs/html
12 # HTMLZip
13 - sphinx-build -b zundler docs/ _readthedocs/$READTHEDOCS_PROJECT
14 - cd _readthedocs ; zip -r -j htmlzip/$READTHEDOCS_PROJECT.zip $READTHEDOCS_PROJECT
15 # PDF
16 - sphinx-build -M simplepdf docs/ _readthedocs/
17 - mv _readthedocs/simplepdf/"Test Builds.pdf" _readthedocs/pdf/$READTHEDOCS_PROJECT.pdf
18 # EPUB
19 - sphinx-build -b epub docs/ /tmp/epub
20 - mv /tmp/epub/TestBuilds.epub _readthedocs/epub/$READTHEDOCS_PROJECT.epub
21
22sphinx:
23 configuration: docs/conf.py
24
25python:
26 install:
27 - requirements: requirements.txt
requirements.txt
used to build these docs.
1sphinx-autorun
2git+https://github.com/AdrianVollmer/Zundler@main#egg=Zundler
3sphinx-simplepdf
4sphinx-rtd-theme
5sphinx<6
6
7# Installed to have the flyout and extras
8readthedocs-sphinx-ext
9
10# Sphinx docs requirements
11sphinxcontrib-websupport
Sphinx configuration file used to build this docs (see full file),
1# -*- coding: utf-8 -*-
2
3# Default settings
4project = 'Test Builds'
5extensions = [
6 # Read the Docs flyout and extras
7 'readthedocs_ext.readthedocs',
8
9 'sphinx_autorun',
10 'sphinx_simplepdf',
11]
12
13latex_engine = 'xelatex' # allow us to build Unicode chars
14
15
16# Include all your settings here
17html_theme = 'sphinx_rtd_theme'
18html_static_path = ['_static']
>>> # Build at
>>> import datetime
>>> datetime.datetime.utcnow() # UTC
datetime.datetime(2023, 1, 25, 10, 20, 56, 785589)