Skip to main content

A pandoc filter for executing (python) code and including the results.

Project description

pandoc-source-exec is a panflute pandoc filter.

It executes code annotated code blocks with the proper executables and adds the output below. Example:

```{ .python .exec }
print('Hello World')

The above can be compiled like this:

    pandoc --filter pandoc-source-exec -o $@ $<

The resulting output will include Hello World after the code block.

pandoc-source-exec offers many other features, including tikz plots, proper figures and code listings as well as including files as code.

For more examples check the example files.


Just use pip to install it from pypi

pip install pandoc-source-exec


  • Execute code other than python
  • Refactor interactive execution, build REPL wrappers.
  • Allow configurable pre- and postfixes for the output

Project details

Download files

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

Files for pandoc-source-exec, version 0.2.2
Filename, size File type Python version Upload date Hashes
Filename, size pandoc-source-exec-0.2.2.tar.gz (7.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page