Skip to main content

A pygments formatter that outputs <fo:inline> tags

Project description

This is a formatter for pygments that produces output marked up with tags with the appropriate colour and other presentational attributes set according to the pygments style in use.

To be useful this must be embeded in a complete xsl-fo document. It was developed for use with asciidoc to produce PDF’s using fop with minimal configuration or extra dependencies.

It is possible that it could be used in more general docbook to pdf tool chains.

Installation

Install from pypi:

$ pip install pygments-xslfo-formatter

To install from the from the source distibution. Use any of the normal installation methods from the top directory of the distribution to install.

$ python setup.py install   # Usual setup.py installation method

$ pip install .             # Using pip

This will install pygments if it is not already installed. You can check that it is working by listing the formatters and checking for the presence of one containing xslfo.

$ pygmentize -L formatters
Formatters:
~~~~~~~~~~~
[... ommitted output ...]
* xslfo, xsl-fo:
    Format tokens as XSL-FO ``<fo:inline>`` tags.

Usage

As this just adds a new formatter type to pygments, you just use’ xslfo’ where ever you might, for example, specify ‘html’ as a formatter name.

$ pygmentize -f xslso -l python setup.py

You should see lots of tags

To use with asciidoc, which is the initial purpose of this extension look at the example directory which contains a simple but complete example.

Example result

You can see an example pdf file here:[1]

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

pygments-xslfo-formatter-1.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

pygments_xslfo_formatter-1.1-py2-none-any.whl (4.2 kB view details)

Uploaded Python 2

File details

Details for the file pygments-xslfo-formatter-1.1.tar.gz.

File metadata

File hashes

Hashes for pygments-xslfo-formatter-1.1.tar.gz
Algorithm Hash digest
SHA256 db12b185153cf88a217a24bc8f4de5c2ff04ec550589161a23e070961d868174
MD5 95fec9d8f2526763b8a0b7b8bd6814fd
BLAKE2b-256 02f32856b0997c392ade07e3574f47795de152183bc03d214525af3673763a64

See more details on using hashes here.

File details

Details for the file pygments_xslfo_formatter-1.1-py2-none-any.whl.

File metadata

File hashes

Hashes for pygments_xslfo_formatter-1.1-py2-none-any.whl
Algorithm Hash digest
SHA256 4a7a22f1d0fc344de4b0def044fd30b5f945bda4cb47e94e08926ceeecc60d88
MD5 d6096863b6734ed5c0d058ffec59f012
BLAKE2b-256 aa9b5e8e94918ea1edf1f4d9984295afd936525662781e35be5ffa556fafe9d2

See more details on using hashes here.

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