prodockit
A family of extensions for Zensical needed for professional and academic documentation: section cross-references, bibliography/citation handling, a glossary, and a Pandoc/WeasyPrint PDF pipeline for the downloadable, submittable document these usually need alongside the website itself.
Most of prodockit is Python-Markdown
extensions, enabled in zensical.toml. prodockit.pdf is a command-line
tool instead (prodockit pdf), since a PDF build pipeline isn't a Markdown
syntax extension - it reads the same zensical.toml too. In addition,
there's a set of website macros (prodockit.zensical_macros) to help use
prodockit's features.
It's a kit for professional documentation, built on Zensical's own Markdown and Pandoc/WeasyPrint PDF pipeline.
Status: early, but functional -
prodockit.headings,prodockit.refs,prodockit.citations,prodockit.glossary,prodockit.tables,prodockit.bibliography,prodockit.index,prodockit.pdf,prodockit.sync_repo,prodockit.pinsandprodockit.zensical_macrosare implemented and tested.prodockit.bootstrapis newer: exercised end to end on macOS against the University of Surrey's GitLab, with Ubuntu and Windows written but not yet run on a real machine.
Installation
Requires Python 3.10 or later (tested on 3.10-3.13).
pip install prodockit
Check what you have with prodockit --version, which prints the bare
number the same way zensical --version does.
prodockit.pdf and prodockit.bibliography additionally need pandoc,
and the PDF build needs weasyprint - external binaries, not Python
packages, so pip doesn't install them. See
Installation
for the full list, including the optional Node tooling for Mermaid
diagrams and TeX maths in the PDF.
Extensions
| Extension | Description |
|---|---|
prodockit.headings |
Gives every heading an id and a hierarchical section number ("1", "1.1", "1.2", "2", ...). |
prodockit.refs |
\ref{id} section cross-references, resolving to the target's current number and name - and \autoref{id}, which additionally carries the target's page number in the PDF. |
prodockit.citations |
Define a source once, cite it by key anywhere with \citeref{id} - auto-generates the bracketed, linked citation text. |
prodockit.glossary |
Define a term once (an acronym expansion, a glossary entry), insert it by id anywhere with \gls{id} - similar in spirit to LaTeX's glossaries package. |
prodockit.tables |
Percentage or fixed column widths on a table, via a width attribute already attachable to a header cell with attr_list. |
prodockit.bibliography |
An alternative to prodockit.citations: define sources in a BibTeX/BibLaTeX .bib file and format \cite{id}/the reference list in any Citation Style Language style, via Pandoc's own --citeproc. |
prodockit.index |
Mark a term inline with \index{Term} for a traditional, PDF-only back-of-book index - with hierarchical sub-entries and code-styled terms. |
import markdown
html = markdown.markdown(
text,
extensions=[
"attr_list", "prodockit.headings", "prodockit.refs", "prodockit.citations", "prodockit.glossary"
],
)
# Introduction {: #intro }
See \ref{intro} for background.\citeref{skou2023} This uses \gls{css}.
Skoulikari, A. (2023) *Learning Git*.
{: #skou2023 data-cite-text="Skoulikari, 2023" }
**CSS** - Cascading Style Sheets.
{: #css data-term="CSS" }
\ref{intro} resolves to a link reading 1 Introduction - the heading's
number and name, with \autoref{intro} additionally carrying its page
number in the PDF; \citeref{skou2023} resolves to [Skoulikari, 2023], linked
to that source; \gls{css} resolves to CSS, linked to its own
definition. All three stay correct if content is reordered, since
resolution happens fresh on every conversion. See the
docs for options, multi-page
registry sharing, and full syntax details.
PDF generation
prodockit.pdf builds a
standalone PDF from your site, via Pandoc and WeasyPrint (both need to be
installed separately - see the docs). No Python required - it reads the
same zensical.toml your site already has:
prodockit pdf
That's it - run it from your project root and it builds a complete PDF,
table of contents included, from every page in your nav. Also handles a
table too wide for a portrait page - printed sideways, on its own
landscape page(s), spanning multiple pages with a repeated heading row -
{.web-only}/{.pdf-only} markers for content that should only appear
in one of the two outputs, and a two-column, letter-headed back-of-book
index (pdf_include_index) generated from prodockit.index's own
\index{Term} markers. See the
docs for the
zensical.toml settings it reads, and for the Python API
(build_pdf(), prodockit.pdf.html/.lua/.css/.icons/.mermaid/.rotate)
if you're scripting your own build pipeline instead.
prodockit source-bundle builds a second, separate PDF - your Markdown
content and zensical.toml, one file per page, into docs_dir - for a
submission that needs the underlying source alongside the document
itself:
prodockit source-bundle
A separate command from prodockit pdf, so a project that wants only one
of the two PDFs doesn't build the other on every run.
Machine setup
prodockit bootstrap
turns the User Guide's install sequence into eleven stages that can each
be checked and repaired individually - editor, git, SSH, clone, remote,
commit identity, pandoc, Node - rather than a long list followed top to
bottom and hoped over:
prodockit bootstrap # report what is set up; changes nothing
prodockit bootstrap --dry-run # print the exact commands it would run
prodockit bootstrap --apply # set up what needs it, asking first
It cannot be the first thing you run - it is a prodockit command, so
Python and pip install prodockit come first. Two steps need a human at
a browser (uploading an SSH key, creating your own project); those are
guided and then verified, rather than automated with a token. Currently
implements the University of Surrey's GitLab only.
Website macros
prodockit.zensical_macros
provides a site-wide word count, the git-detected repository URL, the
latest release tag, chapter/appendix numbering that continues across
pages, and reference/acronym/glossary spacing that matches
prodockit.pdf's own PDF output - as Jinja variables/macros for
Zensical's own macros plugin:
[project.markdown_extensions.zensical.extensions.macros]
modules = ["prodockit.zensical_macros"]
See the docs for the full variable/macro list.
Repository metadata
prodockit sync-repo
keeps repo_url, repo_name, the header brand icon, edit_uri,
site_url and your README's badge row matching the git remote your
checkout actually uses - so forking or mirroring a project between GitHub,
GitLab and Bitbucket doesn't leave stale links, the wrong icon, or a
canonical URL pointing at the old host behind:
prodockit sync-repo # update everything from `origin`
prodockit sync-repo --check # report drift and exit non-zero, for CI
It also sets edit_uri explicitly, which fixes the "edit this page"
button on a self-hosted GitLab and stops it pointing at a master branch
that may not exist.
Version pinning and drift
A documentation build has more inputs than its own source: zensical
renders the site, weasyprint lays out the PDF, and the CI runner image
carries pandoc, the fonts and Chrome. Left unpinned, an upgrade doesn't
fail the build - it quietly publishes a different document.
Pinning them means declaring the same version in several files at once,
which nothing keeps in step.
prodockit pins
finds every declaration and moves them together, keeping each one's own
operator so a library floor stays a floor and a build pin stays exact:
prodockit pins # prompt per package; Enter takes the newest
prodockit pins --check # behind PyPI, or files disagreeing? exit non-zero
prodockit pins -p ubuntu # runner images and container tags too
Pandoc is managed by default too - not a pip package, so it's matched as a
PANDOC_VERSION CI variable rather than a specifier.
It reads pyproject.toml, GitHub Actions workflows, .gitlab-ci.yml and
requirements/constraints files, so the same command works on either
host. The docs also carry a weekly drift job for GitHub Actions and
GitLab CI that rebuilds with the newest versions, diffs the output byte
for byte, and opens an issue when an upgrade would change what you
publish.
Development
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest
zensical is a core dependency, so zensical serve is available as soon as
prodockit is installed - no extra step needed to build the documentation
locally.
Contributing
Contributions are welcome - see CONTRIBUTING.md.
License
MIT - see LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prodockit-0.24.1.tar.gz.
File metadata
- Download URL: prodockit-0.24.1.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e73a0e81482a9afa2330a20334ec562b1916201b8be6bcf4f70a4a255ecdf911
|
|
| MD5 |
d29e6dd1841eab5978ace39e6ed69b29
|
|
| BLAKE2b-256 |
cdfa1cdafd4e5bb917c066ca81b3499c7518df0729b73bff93a71a264758939b
|
Provenance
The following attestation bundles were made for prodockit-0.24.1.tar.gz:
Publisher:
publish.yml on buckwem/prodockit-extensions
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prodockit-0.24.1.tar.gz -
Subject digest:
e73a0e81482a9afa2330a20334ec562b1916201b8be6bcf4f70a4a255ecdf911 - Sigstore transparency entry: 2413348085
- Sigstore integration time:
-
Permalink:
buckwem/prodockit-extensions@2584545e8ff00e3cdfe52fe54a95696e58b19798 -
Branch / Tag:
refs/tags/prodockit-v0.24.1 - Owner: https://github.com/buckwem
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2584545e8ff00e3cdfe52fe54a95696e58b19798 -
Trigger Event:
release
-
Statement type:
File details
Details for the file prodockit-0.24.1-py3-none-any.whl.
File metadata
- Download URL: prodockit-0.24.1-py3-none-any.whl
- Upload date:
- Size: 192.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ca9dcda70124114d91516dc5e145a109a9225875ff1b7ebfdc8b0d5d26405b8
|
|
| MD5 |
b3d0646e414153f5291c4b22b15b4a50
|
|
| BLAKE2b-256 |
1b1584dea96faf3a4d06a400fa0c368bd30b636adbea4ff10fdbdb99bcc192e4
|
Provenance
The following attestation bundles were made for prodockit-0.24.1-py3-none-any.whl:
Publisher:
publish.yml on buckwem/prodockit-extensions
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prodockit-0.24.1-py3-none-any.whl -
Subject digest:
9ca9dcda70124114d91516dc5e145a109a9225875ff1b7ebfdc8b0d5d26405b8 - Sigstore transparency entry: 2413348174
- Sigstore integration time:
-
Permalink:
buckwem/prodockit-extensions@2584545e8ff00e3cdfe52fe54a95696e58b19798 -
Branch / Tag:
refs/tags/prodockit-v0.24.1 - Owner: https://github.com/buckwem
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2584545e8ff00e3cdfe52fe54a95696e58b19798 -
Trigger Event:
release
-
Statement type: