Skip to main content

A Sphinx extension which trims redundant blanks

Project description

https://travis-ci.org/amedama41/sphinxcontrib-trimblank.svg?branch=master

A Sphinx extension, which trims redundant blanks generated due to line breaks or inline-markups from generated documents.

Install

Use pip:

pip install sphinxcontrib-trimblank

Usage

Only add ‘sphinxcontrib.trimblank’ to extensions option in conf.py:

extensions += ['sphinxcontrib.trimblank']

If you want to change the extension behaviour, configure options in conf.py:

# Keep blanks to adjacent to ascii characters in html documents
trimblank_keep_alnum_blank = ['html', 'singlehtml']

All options are listed in Configuration.

Configuration

option name

meaning

default

trimblank_enabled

A list of builder names (‘html’, ‘singlehtml’, ‘latex’, and so on). Only when the builder in the list is used, sphinxcontrib-trimblank will trim blanks. The value may also be a boolean. Then the extension will do, or not do for any builder.

True

trimblank_keep_alnum_blank

A list of builder names (‘html’, ‘singlehtml’, ‘latex’, and so on). Only when the builder in the list is used, sphinxcontrib-trimblank will keep blanks adjacent to an ascii character. The value may also be a boolean. Then the extension will do, or not do for any builder.

False

trimblank_keep_blank_before

A regular expression pattern string to specified characters, which sphinxcontrib-trimblank will keep blanks just before.

'[\s(]'

trimblank_keep_blank_after

A regular expression pattern string to specified characters, which sphinxcontrib-trimblank will keep blanks just after.

'[\s),.:?]'

trimblank_debug

If this value is True, the trimmed texts are output as building messages.

False

Licence

MIT Licence

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

sphinxcontrib-trimblank-1.0.3.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

sphinxcontrib_trimblank-1.0.3-py3-none-any.whl (5.5 kB view hashes)

Uploaded Python 3

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