getpelican/pelican — pull request #1323 by DandyDev (2014-04-21 15:36:23+00:00)
Title: Reader name now accessible for articles and pages

I added an extra metadata field that allows you to access the name of the reader currently used in articles and pages. This is convenient when you want to include/exclude certain format-dependent css/js depending on the format of the page/article. Some extra restructured text css comes to mind.

I didn't know where to put this in the documentation. Any pointers would be welcome :)

All tests are working. I did notice some inconsistencies in the `test_readers.py` though:
Some of the tests (like `RstReaderTest`) read and parse a file like this `page = self.read_file(path='article_with_metadata.rst')`, which in turn uses the `Readers` interface to access the reader, like this:

```python
def read_file(self, path, **kwargs):
# Isolate from future API changes to readers.read_file
r = readers.Readers(settings=get_settings(**kwargs))
return r.read_file(base_path=CONTENT_PATH, path=path)
```

Some other tests (like `MdReaderTest`) access the reader directly, like this:
`reader = readers.MarkdownReader(settings=get_settings())`

Because the reader name gets added in the `Readers` class, it's not accessible in the `MdReaderTest`. Maybe all Reader tests should use the `self.read_file` method?