Merge remote-tracking branch 'gsoc2016/Subtitle-1'
[mediagoblin.git] / mediagoblin / plugins / trim_whitespace / README.rst
1 =======================
2 Trim whitespace plugin
3 =======================
4
5 MediaGoblin templates are written with 80 char limit for better
6 readability. However that means that the HTML output is very verbose
7 containing *lots* of whitespace. This plugin inserts a middleware that
8 filters out whitespace from the returned HTML in the ``Response()``
9 objects.
10
11 Simply enable this plugin by putting it somewhere where Python can reach
12 it and put it's path into the ``[plugins]`` section of your
13 ``mediagoblin.ini`` or ``mediagoblin_local.ini`` like for example this:
14
15 .. code-block:: ini
16
17 [plugins]
18 [[mediagoblin.plugins.trim_whitespace]]
19
20 There is no further configuration required. If this plugin is enabled,
21 all *text/html* documents should not have lots of whitespace in between
22 elements, although it does a very naive filtering right now (just keep
23 the first whitespace and delete all subsequent ones).
24
25 Nonetheless, it is a useful plugin that might serve as inspiration for
26 other plugin writers.
27
28 It was originally conceived by Sebastian Spaeth. It is licensed under
29 the GNU AGPL v3 (or any later version) license.
30