New extension: sphinxcontrib-constdata

13 views
Skip to first unread message

Matt Documatt

unread,
Jan 6, 2022, 10:05:19 AMJan 6
to sphinx...@googlegroups.com
Dear Sphinx community,
after months I finally found enough time to finish and release the extension that I was personally missing in almost every bigger docs project.

* docs: https://documatt.gitlab.io/sphinxcontrib-constdata (crafted in Sphinx, indeed)
* code: https://gitlab.com/documatt/sphinxcontrib-constdata where issues and contributions are welcome

sphinxcontrib-constdata is the extension for Sphinx documentation projects that allows showing values, listing tables, and generating links from CSV, JSON, and YAML files. Instead of hard-coding values in the text, you write constants or queries replaced with value(s) from the external file(s). If the file contains language-sensitive strings, they can be translated with the rest of the Sphinx docs.

For example, instead of hard-coding UI labels like "Close" in

To continue, press Close.

I obtain these external constants from developers in labels.csv and rewrite the sentence to:

To continue, press :constdata:label:`labels.csv?close`.

or, if I set constdata as default domain, to:

To continue, press :label:`labels.csv?close`.

Looking forward to your valuable thoughts.

--
Matt
https://techwriter.documatt.com

Reply all
Reply to author
Forward
0 new messages