template.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # -*- test-case-name: twisted.web.test.test_template -*-
  2. # Copyright (c) Twisted Matrix Laboratories.
  3. # See LICENSE for details.
  4. """
  5. HTML rendering for twisted.web.
  6. @var VALID_HTML_TAG_NAMES: A list of recognized HTML tag names, used by the
  7. L{tag} object.
  8. @var TEMPLATE_NAMESPACE: The XML namespace used to identify attributes and
  9. elements used by the templating system, which should be removed from the
  10. final output document.
  11. @var tags: A convenience object which can produce L{Tag} objects on demand via
  12. attribute access. For example: C{tags.div} is equivalent to C{Tag("div")}.
  13. Tags not specified in L{VALID_HTML_TAG_NAMES} will result in an
  14. L{AttributeError}.
  15. """
  16. __all__ = [
  17. "TEMPLATE_NAMESPACE",
  18. "VALID_HTML_TAG_NAMES",
  19. "Element",
  20. "Flattenable",
  21. "TagLoader",
  22. "XMLString",
  23. "XMLFile",
  24. "renderer",
  25. "flatten",
  26. "flattenString",
  27. "tags",
  28. "Comment",
  29. "CDATA",
  30. "Tag",
  31. "slot",
  32. "CharRef",
  33. "renderElement",
  34. ]
  35. from ._stan import CharRef
  36. from ._template_util import (
  37. CDATA,
  38. TEMPLATE_NAMESPACE,
  39. VALID_HTML_TAG_NAMES,
  40. Comment,
  41. Element,
  42. Flattenable,
  43. Tag,
  44. TagLoader,
  45. XMLFile,
  46. XMLString,
  47. flatten,
  48. flattenString,
  49. renderElement,
  50. renderer,
  51. slot,
  52. tags,
  53. )