Skip to content

add bin/ entrypoint for building PDF #232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ pub
*.css.map
deployment-report.json
build/
venv/
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/`.
8 changes: 8 additions & 0 deletions bin/build_pdf
Original file line number Diff line number Diff line change
@@ -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
8 changes: 7 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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.
Expand Down Expand Up @@ -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".
Expand Down
1 change: 1 addition & 0 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down