Rightdown

an open-source Markdown dialect

with a reference implementation in Python

Why Rightdown?

Rightdown:

  • is almost syntactically identical to markdown
    • every markdown file is already a rightdown file
  • has a modern, class-based Python implementation that:
    • parses rightdown files into a true in-memory graph structure
    • can hand you all the metadata, fields, taxonomies, and links embedded in a document
    • allows fragmented documents, each fragment with individual metadata, fields, etc.
  • has CSS guidelines for rendering

Using Rightdown

Rightdown is part (half) of a PyPi project called "OctoBase".

Assuming any reasonable Python v3.x environment, install with pip:

$ sudo pip install octobase

From then, turning a string of markdown text into HTML is as easy as:

import base

text = '***every markdown file is _already_ a rightdown file***'
html = base.RightDown.From(text).Html()

print(html)

The result should look like:

<section>
  <p><b><i>every markdown file is <u>already</u> a rightdown file</i></b></p>
</section>

Say though we needed this to be wrapped in head and body tags and the like. Merely do this:

html = base.RightDown.From(text).Html(dress=True)
print(html)

The result now should be:

<!DOCTYPE html>
<html lang='en-us'>
<head>
  <meta charset="utf-8">
  <link rel="stylesheet" type="text/css" href="rightdown.css">
</head>
<body class="rightdown">
  <section>
    <p><b><i>every markdown file is <u>already</u> a rightdown file</i></b></p>
  </section>
</body>
</html>

Documentation

the whole documentation for rightdown will one day live right here. until then, please find it inside our source repository: