A Sphinx extension which trims redundant blanks
Project description
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
Built Distribution
File details
Details for the file sphinxcontrib-trimblank-1.0.3.tar.gz
.
File metadata
- Download URL: sphinxcontrib-trimblank-1.0.3.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b17f6d1478d0852617b9dc662ece77b6d7276aa738084d48fa3cce1fee41f72f |
|
MD5 | 20088629886910deb1e0ab61f9a344f1 |
|
BLAKE2b-256 | 0b50b8df8747977315542bc89f24c70616329a774b0a70d707ed2a6967a1e60b |
File details
Details for the file sphinxcontrib_trimblank-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: sphinxcontrib_trimblank-1.0.3-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04bcce0c4cf0410119973c7d6dccd640f3d147b55bb8c28a895a39eba41c171c |
|
MD5 | aa0923b29ccd3c814f3855104737eb3b |
|
BLAKE2b-256 | da7c0d35bf80563b0c49a46703c726698b6bbcb8ef6ae8aa865083428e269cd7 |