Tree @develop-0.10 (Download .tar.gz)
Version 0.10. Subject to change in backwards-incompatible ways without notice.
Feedmark is a format for embedding structured data in Markdown files in a way which is both human-readable and machine-extractable. The structured data is intended to be "curational" in nature. Articles in Chrysoberyl and The Dossier are written in Feedmark.
Informally, the format says that every
h3-level heading in the
Markdown file gives the title of an entity, and may be followed
immediately by the entity's "plaque", which is a bullet list
where every item is in the form "field-name: field-value".
In the same way that a Markdown file is still a readable text file, which is nice, a Feedmark file is still a readable Markdown file, which is still a readable text file, which is nice.
While some structured data formats like YAML are fairly easy to read, many web-based files viewers (such as GitHub's) will automatically format Markdown as HTML, making it that much nicer.
Example Feedmark documents can be found in the
and in the projects mentioned above.
This repository contains a Python program,
feedmark, which is a
reference implementation of a processor for the Feedmark format.
To use it, you can clone this repository and run it as
from the directory of your clone, or you can put the
on your executable search path, and run it as
Or you can install it using
pip install Feedmark==0.9.2019.1015
(Depending on your needs, you may wish to establish a virtual environment first. How to do this is outside the scope of this document.)
feedmark is currently able to do the following things:
Parse and check Feedmark documents
Loading documents will always check that they are minimally well-formed.
You can also check documents against a Feedmark schema, which is simply another Feedmark document, one in which each entry describes a property that entries should have.
feedmark eg/*Sightings*.md --check-against=eg/schema/Llama\ sighting.md
Convert Feedmark documents to various formats
The original use case of this tool was to generate an Atom (née RSS) feed of entries in a document:
feedmark "eg/Recent Llama Sightings.md" --output-atom=feed.xml python -m SimpleHTTPServer 7000 & python -m webbrowser http://localhost:7000/feed.xml
It can now also output entries as JSON, indexed by entry, or by property, or by publication date:
feedmark --output-json eg/*.md feedmark --by-property eg/*.md feedmark --by-publication-date eg/*.md
Output entries as Markdown, or HTML (using the
which generates link anchors on headings compatible with the ones
generated by GitHub).
feedmark --output-markdown eg/*.md feedmark --output-html eg/*.md
Rewrite documents in-place
They will be parsed as Feedmark, and then output as Markdown, to the
same files that were read in as input. (Note! This is destructive;
it is recommended that the original files be under version control such
git, which will easily allow the changes to be reverted if necessary.)
feedmark --rewrite-markdown eg/*.md
Markdown supports "reference-style" links, which are not inline with the text.
feedmark can rewrite reference-style links that match the name of
an entry in a previously-created "refdex", so that they
can be kept current and point to the canonical document in which the
entry exists, since it may exist in multiple, or be moved over time.
feedmark eg/*.md --output-refdex >refdex.json feedmark --input-refdex=refdex.json --rewrite-markdown eg/*.md
Feedmark is a subset of Markdown, which is something it has in common with Falderal, however it has decidedly different goals.
git clone https://git.catseye.tc/Feedmark/
- Update comments on test cases. Chris Pressey 1 year, 4 months ago
- Re-describe what the solution is; --output-refdex-single-filename. Chris Pressey 1 year, 4 months ago
- Implement the requirement that was hiding behind the yak hair. Chris Pressey 1 year, 4 months ago
- Update setup.py with new version and new license. Chris Pressey 1 year, 4 months ago
- Change license to MIT license. Chris Pressey 1 year, 4 months ago
- Add --output-refdex-index option. Chris Pressey 1 year, 4 months ago
- Note TODO split off in README (and HISTORY also.) Chris Pressey 1 year, 4 months ago
- Allow trailing `###` on h3-level section headers. Chris Pressey 1 year, 4 months ago
- Note version 0.9-2019.1015. Chris Pressey 1 year, 4 months ago
- Include feedmark.formats module in package dist. Chris Pressey 1 year, 4 months ago