Skip to main content

CommonMark/Frontmatter reader for Pelican

Project description

Pelican FrontMark

Build Status Coverage Status License Format Supported versions

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.1 (2017-01-08)

  • Test and fix plugin registeration

  • Make version and description available at module level

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pelican_frontmark-1.0.1-py2.py3-none-any.whl (7.2 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page