Quick notes for future projects…
Pelican Plugins Repo
Pelican Plugins is a little bit of a mess. Some of the plugins are setup/expected to be installed via
pip. This is contrary to the suggestion to
git clone the repo and change the
If you’re using the plugins from source and see a
setup.py in a plugin you want to use, you will probably have to:
- copy the source code tree from it’s sub-directory to the top level directory for that plugin
- tweak the imports, e.g. adding
importto look in the current directory
- tweak (or remove)
setup.pyand it’s helper files
Look at other plugins; the documentation is pretty sparse.
article_generator_finalized will give you the final content after going through any of the markup processors.
Not sure what the correct way is for Pelican extension to register a Markdown extension.
BlockProcessors are managed in an ordered dictionary.
BlockProcessors are here: https://github.com/waylan/Python-Markdown/blob/master/markdown/blockprocessors.py
It looks something like:
parser.blockprocessors['empty'] = EmptyBlockProcessor(parser) parser.blockprocessors['indent'] = ListIndentProcessor(parser) parser.blockprocessors['code'] = CodeBlockProcessor(parser) parser.blockprocessors['hashheader'] = HashHeaderProcessor(parser) parser.blockprocessors['setextheader'] = SetextHeaderProcessor(parser) parser.blockprocessors['hr'] = HRProcessor(parser) parser.blockprocessors['olist'] = OListProcessor(parser) parser.blockprocessors['ulist'] = UListProcessor(parser) parser.blockprocessors['quote'] = BlockQuoteProcessor(parser) parser.blockprocessors['paragraph'] = ParagraphProcessor(parser)
A Markdown extension will often have a line like:
md.parser.blockprocessors.add('name', blockprocessor, 'location')
name is the key in the ordered dictionary.
location determines where it’s inserted in the order of
Question: does the entire document get feed through each of the
i.e. can an earlier
BlockProcessor generate MarkDown that will be expanded by latter