CommonMark/Frontmatter reader for Pelican
Project description
Pelican FrontMark
A Pelican CommonMark/Front Matter reader.
This reader marse Markdown files with YAML frontmatter headers and formatted using the CommonMark specifications.
Requirements
Pelican FrontMark works with Pelican 3.7+ and Python 3.3+
Getting started
Install pelican-frontmark with pip:
pip install pelican-frontmark
And enable the plugin in you pelicanconf.py (or any configuration file you want to use):
PLUGINS = [
'...',
'frontmark',
'...',
]
Files format
Frontmark will only recognize files using .md extension.
Here an article example:
---
title: My article title
date: 2017-01-04 13:10
modified: 2017-01-04 13:13
tags:
- tag 1
- tag 2
slug: my-article-slug
lang: en
category: A category
authors: Me
summary: Some summary
status: draft
custom:
title: A custom metadata
details: You can add any structured and typed YAML metadata
---
My article content
Advanced configuration
Settings
`FRONTMARK_PARSE_LITERAL`: True by default. Set it to False if you don’t want multiline string literals (|) to be parsed as markdown.
Registering custom YAML types
You can register custom YAML types using the frontmark_yaml_register signal:
from frontmark.signals import frontmark_yaml_register
def upper_constructor(loader, noder):
return loader.construct_scalar(node).upper()
def register_upper(reader):
return '!upper', upper_constructor
def register():
frontmark_yaml_register.connected(register_upper):
Changelog
1.0.0 (2017-01-08)
Initial release
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for pelican_frontmark-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a88bfd54c9ac01b064ed9f97b76087554de7efa2329ecdb4760962dd42f7843a |
|
MD5 | a3d4e759f0ab614ae5add9cd8c0979fa |
|
BLAKE2b-256 | c71de38adbd79f9925672fe16e21c00418d8c413cbc5e44669685f48e2584faf |