pandoc-purl
pandoc-purl is Pandoc filter for literate programming and dynamic document generation in Python. It is similar in spirit to Knitr or Pweave.
pandoc-purl can be installed through pip
(e.g. python3 -m pip install pandoc-purl), and used like other Pandoc
filters, e.g. pandoc --filter pandoc-purl document.md -o document.tex.
Code chunks
pandoc-purl will process code blocks tagged with the python class or
inline code tagged with the p or python classes.
Note This README.md file has been generated from the README.in.md using pandoc-purl.
Code blocks
Code blocks marked with the python class will behave as if executed in
an interactive Python shell: they execute their content, display the
content and, in a following paragraph, display any printed value as well
as the value of the last expression (see below for options controlling
this behavior).
| Input | Rendered |
|---|---|
|
|
If the last statement is not an expression, the code is still executed and displayed, but no result is printed
| Input | Rendered |
|---|---|
|
Inline code
Inline code marked with the p or python classes should contain only
a single expression, and will display the value of that expression in
the text.
| Input | Rendered |
|---|---|
|
The answer is 42 |
Chunk options
Options can be passed to code chunks using the key=value syntax. The
following options are available:
-
eval: whether to run the code chunk (trueorfalse, defaults totrue)Input Rendered The answer is `6*7`{.p}The answer is 42 The answer is `6*7`{.p eval=false}The answer is 6*7 -
echo: whether to show the code (code blocks only,trueorfalse, defaults totrue)Input Rendered ```python print("Hello pandoc-purl") ```Hello pandoc-purl```{.python echo=false} print("Hello pandoc-purl") ```Hello pandoc-purl -
results: how to show the result of the last expressionasis: show the result as a pre-formatted code block or inline (default)markup: process the result through Pandoc before showing ithide: hide the result
Input Rendered I'm `"**bold**"`{.p}I’m **bold** I'm `"**bold**"`{.p results=markup}I’m bold
Changing the defaults
The default chunk options can also be changed globally by modifying
chunk_defaults in the pandoc_purl module:
```{.python echo=false}
import pandoc_purl
pandoc_purl.chunk_defaults["echo"] = False
```
Metadata
Release files for pandoc-purl 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pandoc-purl-1.0.0.tar.gz | 6.6 kB | Without provenance | Details for pandoc-purl-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pandoc_purl-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for pandoc_purl-1.0.0-py3-none-any.whl |
Total release size: 12.7 kB
Release files / pandoc-purl-1.0.0.tar.gz
| Download URL | pandoc-purl-1.0.0.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
01e6cbc59d16710e5460398cb1bf80d3cecbe2ae70f11b821f8b89237f56b895
|
|
BLAKE2b-256 checksum How to use checksums |
86f897e219ad417dc6ddd241ffd55e39c47f84e8610a1170818ed2fd5ffa6d42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Release files / pandoc_purl-1.0.0-py3-none-any.whl
| Download URL | pandoc_purl-1.0.0-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd96a68d1070bddef79d75d3c51332baf3bc3e48eb5aa540f53ac358c791fa7b
|
|
BLAKE2b-256 checksum How to use checksums |
305099fec545688eec4cfc23d28e1cd7bb6f8e98923f105b656f7859e0e4e92c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Security for pandoc-purl 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.