Skip to content

Commit 2793a4e

Browse files
committed
add bin/ entrypoint for building PDF
To export the docs as a PDF
1 parent f0ea468 commit 2793a4e

File tree

5 files changed

+22
-1
lines changed

5 files changed

+22
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ pub
99
*.css.map
1010
deployment-report.json
1111
build/
12+
venv/

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,12 @@ To inspect the contents of the deb archive you can run:
115115
/usr/share/doc/hndocsnext/README.md
116116
/usr/share/doc/hndocsnext/changelog.gz
117117
```
118+
119+
## Build as PDF
120+
121+
To build the documentation as a single PDF file, run the following command:
122+
```
123+
bin/build_pdf
124+
```
125+
126+
The built PDF will then be in `docs/_build/pdf/`.

bin/build_pdf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
pushd docs
6+
make pdf
7+
echo "pdf located at $(realpath _build/pdf/Python.pdf)"
8+
popd

docs/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
# -- Project information -----------------------------------------------------
2222

2323
project = "Docs"
24-
copyright = "2023, Hypernode"
24+
copyright = "2024, Hypernode"
2525
author = "Hypernode"
26+
version = "https://docs.hypernode.com/"
2627

2728
# The full version, including alpha/beta/rc tags
2829
release = "dev"
@@ -47,6 +48,7 @@
4748
"hypernode.sphinx.extensions.meta_robots",
4849
"hypernode.sphinx.extensions.github_actions_logging",
4950
"sphinxcontrib.mermaid",
51+
"rst2pdf.pdfbuilder",
5052
]
5153

5254
# Add any paths that contain templates here, relative to this directory.

requirements/base.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ sphinx-notfound-page==0.8.3
1111
sphinx-sitemap==2.4.0
1212
GitPython==3.1.30
1313
sphinxcontrib-mermaid==0.7.1
14+
rst2pdf==0.99
1415

1516
# hypernode/ requirements
1617
beautifulsoup4==4.11.1

0 commit comments

Comments
 (0)