Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Daniel Goldsmith 2013-08-08 09:59:15 +01:00
commit 575947c5d5
37 changed files with 797 additions and 240 deletions

View file

@ -48,7 +48,7 @@ Markdown library as well::
$ pip install Markdown
If you want to use AsciiDoc you need to install it from `source
If you want to use AsciiDoc_ you need to install it from `source
<http://www.methods.co.nz/asciidoc/INSTALL.html>`_ or use your operating
system's package manager.
@ -323,6 +323,9 @@ pattern::
This is the content of my super blog post.
Conventions for AsciiDoc_ posts, which should have an ``.asc`` extension, can
be found on the AsciiDoc_ site.
Pelican can also process HTML files ending in ``.html`` and ``.htm``. Pelican
interprets the HTML in a very straightforward manner, reading metadata from
``meta`` tags, the title from the ``title`` tag, and the body out from the
@ -551,3 +554,4 @@ listed on the index page nor on any category page.
.. _virtualenv: http://www.virtualenv.org/
.. _W3C ISO 8601: http://www.w3.org/TR/NOTE-datetime
.. _Fabric: http://fabfile.org/
.. _AsciiDoc: http://www.methods.co.nz/asciidoc/

View file

@ -24,7 +24,7 @@ The logic is separated into different classes and concepts:
then passed to the generators.
* **Readers** are used to read from various formats (AsciiDoc, HTML, Markdown and
reStructuredText for now, but the system is extensible). Given a file, they
reStructuredText for now, but the system is extensible). Given a file, they
return metadata (author, tags, category, etc.) and content (HTML-formatted).
* **Generators** generate the different outputs. For instance, Pelican comes with
@ -44,7 +44,7 @@ method that returns HTML content and some metadata.
Take a look at the Markdown reader::
class MarkdownReader(Reader):
class MarkdownReader(BaseReader):
enabled = bool(Markdown)
def read(self, source_path):

View file

@ -71,6 +71,7 @@ finalized pelican object invoked after al
- minifying js/css assets.
- notify/ping search engines with an updated sitemap.
generator_init generator invoked in the Generator.__init__
readers_init readers invoked in the Readers.__init__
article_generate_context article_generator, metadata
article_generate_preread article_generator invoked before a article is read in ArticlesGenerator.generate_context;
use if code needs to do something before every article is parsed
@ -144,13 +145,13 @@ write and don't slow down pelican itself when they're not active.
No more talking, here is the example::
from pelican import signals
from pelican.readers import EXTENSIONS, Reader
from pelican.readers import BaseReader
# Create a new reader class, inheriting from the pelican.reader.Reader
class NewReader(Reader):
# Create a new reader class, inheriting from the pelican.reader.BaseReader
class NewReader(BaseReader):
enabled = True # Yeah, you probably want that :-)
# The list of extensions you want this reader to match with.
# The list of file extensions you want this reader to match with.
# In the case multiple readers use the same extensions, the latest will
# win (so the one you're defining here, most probably).
file_extensions = ['yeah']
@ -168,12 +169,12 @@ No more talking, here is the example::
return "Some content", parsed
def add_reader(arg):
EXTENSIONS['yeah'] = NewReader
def add_reader(readers):
readers.reader_classes['yeah'] = NewReader
# this is how pelican works.
def register():
signals.initialized.connect(add_reader)
signals.readers_init.connect(add_reader)
Adding a new generator

View file

@ -84,9 +84,10 @@ Setting name (default value) What doe
here or a single string representing one locale.
When providing a list, all the locales will be tried
until one works.
`MARKUP` (``('rst', 'md')``) A list of available markup languages you want
to use. For the moment, the only available values
are `rst`, `md`, `markdown`, `mkd`, `mdown`, `html`, and `htm`.
`READERS` (``{}``) A dict of file extensions / Reader classes to overwrite or
add file readers. for instance, to avoid processing .html files:
``READERS = {'html': None}``. Or to add a custom reader for the
`foo` extension: ``READERS = {'foo': FooReader}``
`IGNORE_FILES` (``['.#*']``) A list of file globbing patterns to match against the
source files to be ignored by the processor. For example,
the default ``['.#*']`` will ignore emacs lock files.
@ -244,7 +245,7 @@ Setting name (default value) What does it do?
`CATEGORY_SAVE_AS` (``'category/{slug}.html'``) The location to save a category.
`TAG_URL` (``'tag/{slug}.html'``) The URL to use for a tag.
`TAG_SAVE_AS` (``'tag/{slug}.html'``) The location to save the tag page.
`TAGS_URL` (``'tag/{slug}.html'``) The URL to use for the tag list.
`TAGS_URL` (``'tags.html'``) The URL to use for the tag list.
`TAGS_SAVE_AS` (``'tags.html'``) The location to save the tag list.
`AUTHOR_URL` (``'author/{slug}.html'``) The URL to use for an author.
`AUTHOR_SAVE_AS` (``'author/{slug}.html'``) The location to save an author.