A family of extensions for Zensical needed for professional and academic documentation: section cross-references, bibliography/citation handling, a glossary, a Pandoc/WeasyPrint PDF pipeline, and Jinja macros for word counts and reference-style spacing
Project description
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.pdf, andprodockit.zensical_macrosare implemented and tested.
Installation
pip install prodockit
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 - similar in spirit to LaTeX's \ref. |
prodockit.citations |
Define a source once, cite it by key anywhere with \cite{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. |
import markdown
html = markdown.markdown(
text,
extensions=[
"attr_list", "prodockit.headings", "prodockit.refs", "prodockit.citations", "prodockit.glossary"
],
)
# Introduction {: #intro }
See \ref{intro} for background.\cite{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 - the heading's current
section number; \cite{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 -
and {.web-only}/{.pdf-only} markers for content that should only
appear in one of the two outputs. 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.
Website macros
prodockit.zensical_macros
provides a site-wide word count, the git-detected repository URL, 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.
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.
License
MIT - see LICENSE.
Project details
Release history Release notifications | RSS feed
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.4.0.tar.gz.
File metadata
- Download URL: prodockit-0.4.0.tar.gz
- Upload date:
- Size: 128.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8d5e96b447dfcd088d7c46e17e19f8e32f48768b341f79c85484b364231bb28
|
|
| MD5 |
4c819b2ccecc1a59debbf513b2dfe36c
|
|
| BLAKE2b-256 |
9684d1d92a55c36a76efcb1136cf10372f9bfb3fb91d57d27848eabf1dbde78a
|
Provenance
The following attestation bundles were made for prodockit-0.4.0.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.4.0.tar.gz -
Subject digest:
c8d5e96b447dfcd088d7c46e17e19f8e32f48768b341f79c85484b364231bb28 - Sigstore transparency entry: 2195151573
- Sigstore integration time:
-
Permalink:
buckwem/prodockit-extensions@0e4a828bd1122830c5a7cf0080fc61f996ef7129 -
Branch / Tag:
refs/tags/prodockit-v0.4.0 - Owner: https://github.com/buckwem
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0e4a828bd1122830c5a7cf0080fc61f996ef7129 -
Trigger Event:
release
-
Statement type:
File details
Details for the file prodockit-0.4.0-py3-none-any.whl.
File metadata
- Download URL: prodockit-0.4.0-py3-none-any.whl
- Upload date:
- Size: 82.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b52bd78ce12bfb8bbc36eee6d724df007cb2196b982e467183b4fba71d780e3c
|
|
| MD5 |
6a9ffef3fea6c5e6fa5bd368c3e6be4e
|
|
| BLAKE2b-256 |
3f30fba1a72ddcd38af51c16e2dca2e3ffe9475983a7f0c90238e49b35aa63c8
|
Provenance
The following attestation bundles were made for prodockit-0.4.0-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.4.0-py3-none-any.whl -
Subject digest:
b52bd78ce12bfb8bbc36eee6d724df007cb2196b982e467183b4fba71d780e3c - Sigstore transparency entry: 2195151577
- Sigstore integration time:
-
Permalink:
buckwem/prodockit-extensions@0e4a828bd1122830c5a7cf0080fc61f996ef7129 -
Branch / Tag:
refs/tags/prodockit-v0.4.0 - Owner: https://github.com/buckwem
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0e4a828bd1122830c5a7cf0080fc61f996ef7129 -
Trigger Event:
release
-
Statement type: