diff --git a/.gitignore b/.gitignore index ca98c103..8d778373 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ pub *.css.map deployment-report.json build/ +venv/ diff --git a/README.md b/README.md index 793b792d..5c27e9a4 100644 --- a/README.md +++ b/README.md @@ -115,3 +115,12 @@ To inspect the contents of the deb archive you can run: /usr/share/doc/hndocsnext/README.md /usr/share/doc/hndocsnext/changelog.gz ``` + +## Build as PDF + +To build the documentation as a single PDF file, run the following command: +``` +bin/build_pdf +``` + +The built PDF will then be in `docs/_build/pdf/`. diff --git a/bin/build_pdf b/bin/build_pdf new file mode 100755 index 00000000..809e0a20 --- /dev/null +++ b/bin/build_pdf @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +pushd docs +make pdf +echo "pdf located at $(realpath _build/pdf/hypernode_documentation.pdf)" +popd diff --git a/docs/conf.py b/docs/conf.py index 3e119e29..9b580421 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -21,8 +21,9 @@ # -- Project information ----------------------------------------------------- project = "Docs" -copyright = "2023, Hypernode" +copyright = "2024, Hypernode" author = "Hypernode" +version = "https://docs.hypernode.com/" # The full version, including alpha/beta/rc tags release = "dev" @@ -47,6 +48,7 @@ "hypernode.sphinx.extensions.meta_robots", "hypernode.sphinx.extensions.github_actions_logging", "sphinxcontrib.mermaid", + "rst2pdf.pdfbuilder", ] # Add any paths that contain templates here, relative to this directory. @@ -95,6 +97,10 @@ ] ) +pdf_documents = [ + ("index", "hypernode_documentation", "Hypernode Documentation", "by Hypernode"), +] + # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". diff --git a/requirements/base.txt b/requirements/base.txt index e961ec16..3726e246 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -11,6 +11,7 @@ sphinx-notfound-page==0.8.3 sphinx-sitemap==2.4.0 GitPython==3.1.30 sphinxcontrib-mermaid==0.7.1 +rst2pdf==0.99 # hypernode/ requirements beautifulsoup4==4.11.1