markup.txt 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. =====================
  2. django.contrib.markup
  3. =====================
  4. .. module:: django.contrib.markup
  5. :synopsis: A collection of template filters that implement common markup languages.
  6. Django provides template filters that implement the following markup
  7. languages:
  8. * ``textile`` -- implements `Textile`_ -- requires `PyTextile`_
  9. * ``markdown`` -- implements `Markdown`_ -- requires `Python-markdown`_
  10. * ``restructuredtext`` -- implements `ReST (ReStructured Text)`_
  11. -- requires `doc-utils`_
  12. In each case, the filter expects formatted markup as a string and
  13. returns a string representing the marked-up text. For example, the
  14. ``textile`` filter converts text that is marked-up in Textile format
  15. to HTML.
  16. To activate these filters, add ``'django.contrib.markup'`` to your
  17. :setting:`INSTALLED_APPS` setting. Once you've done that, use
  18. ``{% load markup %}`` in a template, and you'll have access to these filters.
  19. For more documentation, read the source code in
  20. :file:`django/contrib/markup/templatetags/markup.py`.
  21. .. _Textile: http://en.wikipedia.org/wiki/Textile_%28markup_language%29
  22. .. _Markdown: http://en.wikipedia.org/wiki/Markdown
  23. .. _ReST (ReStructured Text): http://en.wikipedia.org/wiki/ReStructuredText
  24. .. _PyTextile: http://loopcore.com/python-textile/
  25. .. _Python-markdown: http://www.freewisdom.org/projects/python-markdown
  26. .. _doc-utils: http://docutils.sf.net/
  27. ReStructured Text
  28. -----------------
  29. When using the ``restructuredtext`` markup filter you can define a
  30. :setting:`RESTRUCTUREDTEXT_FILTER_SETTINGS` in your django settings to
  31. override the default writer settings. See the `restructuredtext writer
  32. settings`_ for details on what these settings are.
  33. .. _restructuredtext writer settings: http://docutils.sourceforge.net/docs/user/config.html#html4css1-writer