# Liquid-style Tags *Author: Jake Vanderplas * This plugin allows liquid-style tags to be inserted into Markdown within Pelican documents via tags bounded by `{% ... %}`, a convention also used to extend Markdown in other publishing platforms such as Octopress. This set of extensions does not actually interface with liquid, but allows users to define their own liquid-style tags which will be inserted into the Markdown preprocessor stream. There are several built-in tags, which can be added as follows. First, in your pelicanconf.py file, add the plugins you want to use: PLUGIN_PATH = '/path/to/pelican-plugins' PLUGINS = ['liquid_tags.img', 'liquid_tags.video', 'liquid_tags.youtube', 'liquid_tags.vimeo', 'liquid_tags.include_code', 'liquid_tags.notebook'] Following below is more information about these and other tags. ## Image Tag To insert a sized and labeled image in your document, enable the `liquid_tags.img` plugin and use the following: {% img [class name(s)] path/to/image [width [height]] [title text | "title text" ["alt text"]] %} ### Base64 Image (inline image) tag `b64img` is based on the`img` tag, but instead of inserting a link to the image it encodes it as base64 text and inserts it into a`` will be collapsed when the HTML page is loaded and can be expanded by tapping on them. Cells containing the comment line `# ` will be expanded on load but can be collapsed by tapping on their header. Cells without collapsed comments are rendered as standard code input cells. ## Configuration settings in custom tags Tags do not have access to the full Pelicans settings, and instead arrange for the variables to be passed to the tag. For tag authors who plan to add their tag as in-tree tags, they can just add the variables they need to an array in `mdx_liquid_tags.py`, but out-of-tree tags can specify which variables they need by including a tuple of (variable, default value, helptext) in the user's `pelicanconf.py` settings: LIQUID_CONFIGS = (('PATH', '.', "The default path"), ('SITENAME', 'Default Sitename', 'The name of the site')) ## Testing To test the plugin in multiple environments we use [tox](http://tox.readthedocs.org/en/latest/). To run the entire test suite: cd path/to/liquid_tags tox [IPython]: http://ipython.org/