Skip to main content

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. Each piece is independent, so you only pay for what you use.

Most of prodockit is Python-Markdown extensions, in the spirit of pymdown-extensions - configure one the same way as any other Zensical/pymdownx Markdown extension, via 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.

Status: early, but functional - prodockit.headings, prodockit.refs, prodockit.citations, prodockit.glossary, prodockit.pdf, and prodockit.zensical_macros are implemented and tested.

Full documentation

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.
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. See the docs for the zensical.toml settings it reads, and for the Python API (build_pdf(), prodockit.pdf.html/.lua/.css/.icons/.mermaid) 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prodockit-0.1.0.tar.gz (98.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prodockit-0.1.0-py3-none-any.whl (67.6 kB view details)

Uploaded Python 3

File details

Details for the file prodockit-0.1.0.tar.gz.

File metadata

  • Download URL: prodockit-0.1.0.tar.gz
  • Upload date:
  • Size: 98.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for prodockit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1f532c31201b953e1985b893062f3295ad6b2b82aaee83fc43e9ed0ec07232d5
MD5 94d166ce68f76862a47c87237d7edbef
BLAKE2b-256 e538e586e3255bc788437cd3a20ca68ad4719bc550d2d42152c34319c4cea73f

See more details on using hashes here.

Provenance

The following attestation bundles were made for prodockit-0.1.0.tar.gz:

Publisher: publish.yml on buckwem/zendoc-extensions

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file prodockit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: prodockit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 67.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for prodockit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 676c26e41f67f55d652c5428c3e0c204529d94d5ab472a40a6cf01c9a30d8ff0
MD5 a55162f8ed7b24ca49eafd0ce807e2c8
BLAKE2b-256 469cf0a2ddaf8506790e4e734fba0cc7dfa60c11d53ab88395be22c51c916833

See more details on using hashes here.

Provenance

The following attestation bundles were made for prodockit-0.1.0-py3-none-any.whl:

Publisher: publish.yml on buckwem/zendoc-extensions

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page