roles.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # -*- coding: utf-8 -*-
  2. # -----------------------------------------------------------------------------
  3. # Bootstrap RST
  4. # Copyright (c) 2014, Nicolas P. Rougier
  5. # Distributed under the (new) BSD License. See LICENSE.txt for more info.
  6. # -----------------------------------------------------------------------------
  7. from docutils import nodes, utils
  8. from docutils.parsers.rst import roles
  9. class h1(nodes.Inline, nodes.TextElement): pass
  10. class h2(nodes.Inline, nodes.TextElement): pass
  11. class h3(nodes.Inline, nodes.TextElement): pass
  12. class h4(nodes.Inline, nodes.TextElement): pass
  13. class h5(nodes.Inline, nodes.TextElement): pass
  14. class h6(nodes.Inline, nodes.TextElement): pass
  15. class label_default(nodes.Inline, nodes.TextElement): pass
  16. class label_muted(nodes.Inline, nodes.TextElement): pass
  17. class label_primary(nodes.Inline, nodes.TextElement): pass
  18. class label_success(nodes.Inline, nodes.TextElement): pass
  19. class label_info(nodes.Inline, nodes.TextElement): pass
  20. class label_warning(nodes.Inline, nodes.TextElement): pass
  21. class label_danger(nodes.Inline, nodes.TextElement): pass
  22. roles.register_generic_role('h1',h1)
  23. roles.register_generic_role('h2',h2)
  24. roles.register_generic_role('h3',h3)
  25. roles.register_generic_role('h4',h4)
  26. roles.register_generic_role('h5',h5)
  27. roles.register_generic_role('h6',h6)
  28. roles.register_generic_role('label-default',label_default)
  29. roles.register_generic_role('label-muted',label_muted)
  30. roles.register_generic_role('label-primary',label_primary)
  31. roles.register_generic_role('label-success',label_success)
  32. roles.register_generic_role('label-info',label_info)
  33. roles.register_generic_role('label-warning',label_warning)
  34. roles.register_generic_role('label-danger',label_danger)