literal.py 667 B

12345678910111213141516171819202122232425262728
  1. """
  2. Literal Tag
  3. -----------
  4. This implements a tag that allows explicitly showing commands which would
  5. otherwise be interpreted as a liquid tag.
  6. For example, the line
  7. {% literal video arg1 arg2 %}
  8. would result in the following line:
  9. {% video arg1 arg2 %}
  10. This is useful when the resulting line would be interpreted as another
  11. liquid-style tag.
  12. """
  13. from .mdx_liquid_tags import LiquidTags
  14. @LiquidTags.register('literal')
  15. def literal(preprocessor, tag, markup):
  16. return '{%% %s %%}' % markup
  17. #----------------------------------------------------------------------
  18. # This import allows image tag to be a Pelican plugin
  19. from liquid_tags import register