Skip to content

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

License

Notifications You must be signed in to change notification settings

amedama41/sphinxcontrib-trimblank

Repository files navigation

sphinxcontrib-trimblank

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.

Note

This extension is inspired by japansesupport.py. sphinxcontrib-trimblank is more friendly for ascii characters appearing in your document.

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published