Commit | Line | Data |
---|---|---|
99454686 SS |
1 | ======================= |
2 | Trim whitespace plugin | |
3 | ======================= | |
4 | ||
9650aa39 | 5 | MediaGoblin templates are written with 80 char limit for better |
f4a5325e BP |
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. | |
99454686 | 10 | |
f4a5325e BP |
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 | |
99454686 SS |
16 | |
17 | [plugins] | |
18 | [[mediagoblin.plugins.trim_whitespace]] | |
19 | ||
20 | There is no further configuration required. If this plugin is enabled, | |
f4a5325e | 21 | all *text/html* documents should not have lots of whitespace in between |
99454686 SS |
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 |