Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

Awesome Lists containing this project

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.