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
Release files for sphinxcontrib-trimblank 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sphinxcontrib-trimblank-1.0.3.tar.gz | 4.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sphinxcontrib_trimblank-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.3 kB
Release files / sphinxcontrib-trimblank-1.0.3.tar.gz
| Download URL | sphinxcontrib-trimblank-1.0.3.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b17f6d1478d0852617b9dc662ece77b6d7276aa738084d48fa3cce1fee41f72f
|
|
BLAKE2b-256 checksum How to use checksums |
0b50b8df8747977315542bc89f24c70616329a774b0a70d707ed2a6967a1e60b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / sphinxcontrib_trimblank-1.0.3-py3-none-any.whl
| Download URL | sphinxcontrib_trimblank-1.0.3-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
04bcce0c4cf0410119973c7d6dccd640f3d147b55bb8c28a895a39eba41c171c
|
|
BLAKE2b-256 checksum How to use checksums |
da7c0d35bf80563b0c49a46703c726698b6bbcb8ef6ae8aa865083428e269cd7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|