python-frontmatter | Parse and manage posts with YAML frontmatter | YAML Processing library
kandi X-RAY | python-frontmatter Summary
kandi X-RAY | python-frontmatter Summary
Jekyll-style YAML front matter offers a useful way to add arbitrary, structured metadata to text documents, regardless of type. This is a small package to load and parse files (or just text) with YAML (or JSON, TOML or other) front matter.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Load data from file descriptor
- Parse text into metadata and content
- Detect the format of the text
- Parse text into Post object
- Detect if the text is in the given text
- Convert text to unicode
- Dump data to fd
- Serialize data to YAML format
- Check the contents of a given file descriptor
- Checks if the given text is a valid format
- Format a post
- Exports the given metadata
- Export metadata to YAML file
- Export metadata
- Return a dict representation of the message
python-frontmatter Key Features
python-frontmatter Examples and Code Snippets
Community Discussions
Trending Discussions on python-frontmatter
QUESTION
I have a folder of Markdown files. Each file contains a block of YAML frontmatter. I am trying to output the title's from each file's frontmatter into a Jinja2 template, and list them all in a HTML file.
I have no issue displaying the titles without Jinja2, but it all falls apart when I try to output to my Jinja2 template.
Here's an example of the Markdown files I'm working with, and the title:
item I am trying to list:
ANSWER
Answered 2021-Mar-27 at 04:24
{% for key, value in frontmatter.items() %}
- {{ value.title() }}
{% endfor %}
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install python-frontmatter
You can use python-frontmatter like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page