Skip to main content

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

Syntax highlighting

By default, FrontMark outputs code blocks in a standard html5 way, ie. a pre>code block with a language class. This allow to use any html5 syntax highlight JavaScript lib.

You can force Pygments usage to output html4 pre rendered syntax highlight by setting FRONTMARK_PYGMENTS to True for default parameters or manually setting it to a dict of Pygments HtmlRenderer parameters.

FRONTMARK_PYGMENTS = {
    'linenos': 'inline',
}

Settings

  • `FRONTMARK_PARSE_LITERAL`: True by default. Set it to False if you don’t want multiline string literals (|) to be parsed as markdown.

  • `FRONTMARK_PYGMENTS`: Not defined by default and output standard html5 code blocks. Can be set to True to force Pygments usage with default parameters or a dict of Pygments parameters

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):

Testing

To test the plugin against all supported Python versions, run tox:

tox

To test only within your current Python version with pytest:

pip install -e .[test]  # Install with test dependencies
pytest  # Launch pytest test suite

or let setuptools do the job:

python setup.py test

Changelog

1.2.1 (2019-12-09)

  • Support CommonMark 0.9.1

1.2.0 (2018-09-08)

  • Upgrade to CommonMark 0.8+

  • Drop support for Python version prior to 3.5

1.1.0 (2017-01-22)

  • Added FRONTMARK_PYGMENTS optionnal setting for Pygments rendering

  • Fix links handling (ie. {filename}…)

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

Metadata

Release files for pelican-frontmark 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for pelican-frontmark 1.2.1
File Interpreter ABI Platform Actions
pelican_frontmark-1.2.1-py2.py3-none-any.whl Python 2, Python 3 none any Details for pelican_frontmark-1.2.1-py2.py3-none-any.whl

Release files / pelican_frontmark-1.2.1-py2.py3-none-any.whl

Download URL pelican_frontmark-1.2.1-py2.py3-none-any.whl
Size 7.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
365c3e0ffdf1e467f3585f3b934300c5b55a2dc13148f158fcb8ea003df1c55a
BLAKE2b-256 checksum
How to use checksums
42d95d51fb9ef82c0040699c167e729323f2cb8a193bd7b18d1a80358589ea49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.8

Security for pelican-frontmark 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page