Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tetherless-world/markdown-rdfa
A Python Markdown extension that lets authors embed RDFa Lite in markdown documents rendered to HTML.
https://github.com/tetherless-world/markdown-rdfa
Last synced: 5 days ago
JSON representation
A Python Markdown extension that lets authors embed RDFa Lite in markdown documents rendered to HTML.
- Host: GitHub
- URL: https://github.com/tetherless-world/markdown-rdfa
- Owner: tetherless-world
- License: apache-2.0
- Created: 2015-09-20T03:59:52.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-04-22T21:47:37.000Z (over 5 years ago)
- Last Synced: 2024-08-02T12:48:15.014Z (3 months ago)
- Language: Python
- Size: 9.77 KB
- Stars: 36
- Watchers: 6
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - tetherless-world/markdown-rdfa - A Python Markdown extension that lets authors embed RDFa Lite in markdown documents rendered to HTML. (others)
README
# RDFa Lite for Markdown
A [Python Markdown](http://pythonhosted.org/Markdown/) extension that lets authors embed RDFa Lite in [markdown documents](http://daringfireball.net/projects/markdown/) rendered to HTML. RDFa Lite is a simple way to add facts about things that you talk about on your web pages.Here's a simple (but complete) example of the sorts of RDFa annotations you can use in markdown-rdfa:
```markdown
(vocab http://schema.org/)
(prefix ov: htttp://open.vocab.org/terms/)
(about #manu)(a Person)
My name is (name)[Manu Sporny] and you can give me a ring via (telephone)[1-800-555-0199].
(url)[my homepage](http://manu.sporny.org/),
!(image)[](http://manu.sporny.org/images/manu.png)
My favorite animal is the (ov:preferredAnimal)[Liger].
```This example compiles to the canonical example from the [RDFa Lite primer](http://www.w3.org/TR/rdfa-lite/):
```html
My name is
Manu Sporny
and you can give me a ring via
1-800-555-0199.
my homepage,
My favorite animal is the Liger.
```Note that it is possible to generate invalid RDFa simply by including literals where there should be URIs or CURIEs, improperly formatting a prefix element, or not declaring a prefix before using it. Today, this is on the honor system, partly because markdown can be embedded in a surrounding HTML that would address some of these issues by declaring prefixes, setting vocabularies, etc.
# Installation
To install via pip, use the following command:
```
pip install git+git://github.com/tetherless-world/markdown-rdfa.git#egg=markdown-rdfa
```# Using the extension
There are detailed instructions at the python markdown site, but to run markdown-rdfa on a document from the command line, simply try this:
```
python -m markdown -x rdfa example.rmd
```example.rmd is an example markdown-rdfa document.