Skip to main content

Read Pelican metadata from link references

Project description

Pelican Markdown Unrendered Metadata

Read Pelican metadata from link references.

Usage

Write metadata in the form [//Pelican/KEY]: # (VALUE). They can be placed anywhere in the document. If the first text content is a top-level heading, the heading is removed from the document, and used as the title. For example,

# Hello, world!

[//Pelican/date]: # (2000-10-31 00:00)
[//Pelican/author]: # (Noname)

Goodbye, world!

The equivalent MultiMarkdown document used by Pelican would be

title: Hello, world!
date: 2000-10-31 00:00
author: Noname

Goodbye, world!

If a key has multiple sources (references, MultiMarkdown, heading), the order of stored value is unspecified.

Installation

If PLUGINS is not specified inside pelicanconf.py, then installing this package should be sufficient setup. Otherwise, inside pelicanconf.py, add markdown_unrendered_metadata to the PLUGINS list variable.

If copying the plugin is preferred, add the src directory to the PLUGIN_PATHS list variable. For example, if this README.md file is at the path ${project_root}/plugins/pelican-markdown-unrendered-metadata/README.md, then the two variables in ${project_root}/pelicanconf.py should contain

PLUGINS = [
  'markdown_unrendered_metadata',
]
PLUGIN_PATHS = [
  'plugins/pelican-markdown-unrendered-metadata/src',
]

Raison d'être

Pelican metadata of Markdown documents are colon-separated key-value pairs at the beginning of the document. Markdown parsers see them as a block of text and generate an unintended paragraph when rendered.

To mitigate this, the metadata can be embedded inside a form of Markdown comments. This plugin uses link references as comments, suggested by a StackOverflow answer:

[//]: # (This may be the most platform independent comment)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pelican-markdown-unrendered-metadata-0.1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file pelican-markdown-unrendered-metadata-0.1.0.tar.gz.

File metadata

  • Download URL: pelican-markdown-unrendered-metadata-0.1.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.7.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pelican-markdown-unrendered-metadata-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e34e18ab687a9f4e0a6e905550311689ab84dba0e38625f1774eaf44bca3d2b8
MD5 ecfd1d8a442d3d53d96b24f912ff6612
BLAKE2b-256 7568b9d81cecc245c5b85d50eaad73d4b36ed55490bcb95338256c818e92f80c

See more details on using hashes here.

File details

Details for the file pelican_markdown_unrendered_metadata-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pelican_markdown_unrendered_metadata-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.7.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pelican_markdown_unrendered_metadata-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42837b1c244befd958f02d67b40dbc25a5276189b4fea8e0aa1c81eddfeea067
MD5 cfd68a3fa2d264d6c4a92cf3bd76842f
BLAKE2b-256 7f5dab2fd98109a38df6234b3fa26d92960434919f84dc18a733008fce8e8b1a

See more details on using hashes here.

Supported by

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