1
0
Fork 0
forked from github/pelican

Document Reader.enabled attribute usage.

This commit is contained in:
James Rowe 2011-02-24 05:17:05 +00:00
commit 6fc6a4dac9

View file

@ -40,7 +40,8 @@ method, that is returning an HTML content and some metadata.
Take a look to the Markdown reader::
class MarkdownReader(object):
class MarkdownReader(Reader):
enabled = bool(Markdown)
def read(self, filename):
"""Parse content and metadata of markdown files"""
@ -59,6 +60,12 @@ Take a look to the Markdown reader::
Simple isn't it ?
If your new reader requires additional Python dependencies then you should wrap
their `imports` statements in `try...except`. Then inside the reader's class
set the `enabled` class attribute to mark import success or failure. This makes
it possible for users to continue using their favourite markup method without
needing to install modules for all the additional formats they don't use.
How to implement a new generator ?
==================================