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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file sphinxcontrib-trimblank-1.0.3.tar.gz.

File metadata

File hashes

Hashes for sphinxcontrib-trimblank-1.0.3.tar.gz
Algorithm Hash digest
SHA256 b17f6d1478d0852617b9dc662ece77b6d7276aa738084d48fa3cce1fee41f72f
MD5 20088629886910deb1e0ab61f9a344f1
BLAKE2b-256 0b50b8df8747977315542bc89f24c70616329a774b0a70d707ed2a6967a1e60b

See more details on using hashes here.

File details

Details for the file sphinxcontrib_trimblank-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinxcontrib_trimblank-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 04bcce0c4cf0410119973c7d6dccd640f3d147b55bb8c28a895a39eba41c171c
MD5 aa0923b29ccd3c814f3855104737eb3b
BLAKE2b-256 da7c0d35bf80563b0c49a46703c726698b6bbcb8ef6ae8aa865083428e269cd7

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