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:

example.pdf: example.md example.py
    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.

Installation

Just use pip to install it from pypi

pip install pandoc-source-exec

Future

  • 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.

Source Distribution

pandoc-source-exec-0.2.2.tar.gz (7.2 kB view details)

Uploaded Source

File details

Details for the file pandoc-source-exec-0.2.2.tar.gz.

File metadata

  • Download URL: pandoc-source-exec-0.2.2.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for pandoc-source-exec-0.2.2.tar.gz
Algorithm Hash digest
SHA256 89f9650b0d710c9cd25a84c048885375f6bb4a2e51ec4c429ee3f777a1f204a6
MD5 a6d6e2d3891cdd7876d59636413b0c35
BLAKE2b-256 049c33ca822f74ecb477e1dde5d8a878d9f77519b988352cb00fb25d555f9102

See more details on using hashes here.

Supported by

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