README.rst 1.1 KB

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