-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from pR0Ps/master
Misc fixes (basically a rewrite)
- Loading branch information
Showing
11 changed files
with
57 additions
and
296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,2 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
bin/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
|
||
# Translations | ||
*.mo | ||
|
||
# Mr Developer | ||
.mr.developer.cfg | ||
.project | ||
.pydevproject | ||
|
||
# Rope | ||
.ropeproject | ||
|
||
# Django stuff: | ||
*.log | ||
*.pot | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "markdown_metayaml"] | ||
path = markdown_metayaml | ||
url = https://github.com/teoric/python-markdown-yaml-meta-data.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .md_metayaml import * |
Submodule markdown_metayaml
added at
dd7f3b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from pelican import signals | ||
from pelican.readers import MarkdownReader | ||
|
||
from .markdown_metayaml.meta_yaml import MetaYamlExtension | ||
|
||
class MarkdownYAMLReader(MarkdownReader): | ||
"""Reader for Markdown files with YAML metadata""" | ||
|
||
def __init__(self, *args, **kwargs): | ||
super(MarkdownYAMLReader, self).__init__(*args, **kwargs) | ||
self.extensions.append(MetaYamlExtension()) | ||
|
||
def _parse_metadata(self, meta): | ||
"""Return the dict containing document metadata""" | ||
|
||
# MarkdownReader _parse_metadata() expects a list of length 1 | ||
# containing a string of comma-seperated values for authors and tags | ||
for x in ("tags", "authors"): | ||
if x in meta: | ||
meta[x] = [",".join(meta[x])] | ||
|
||
return super(MarkdownYAMLReader, self)._parse_metadata(meta) | ||
|
||
def add_reader(readers): | ||
for k in MarkdownYAMLReader.file_extensions: | ||
readers.reader_classes[k] = MarkdownYAMLReader | ||
|
||
def register(): | ||
signals.readers_init.connect(add_reader) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.