completeness
this project is in-progress
task status markdown parsing done metadata extraction done render standard html done render naked text done render markdown incomplete render better html incomplete render pdf not started documentation mostly done known bugs and shortcomings are in the bug list
send us your best love and maybe some money to hasten our progress
:)
rightdown is part of the open-source python library octobase, which is installed via pip:
sudo pip install octobase
given thing which is either a string or an open text file:
import base rd = base.RightDown.From(thing)
or given a path to a file:
rd = base.RightDown.Load(filepath)
in either case the rd that’s returned is an instance of base.RightDown and represents a fully parsed document
this RightDown object has properties and methods for many nifty things, like extracting metadata, and rendering to HTML or text:
print('Metadata:')
print(rd.metadata) # dictionary
print('HTML:')
print(rd.Html()) # string
print('Normalized markdown:')
print(rd.Text()) # stringparser options may be passed as keywords to Rightdown.From()
tab_width – how many spaces equals a tab – default: 2indented_code_width – how many spaces for an indented code block – default: 4this means that any line indented four or more spaces is considered an indented code block, but a tab is only two spaces. in other words, a single tab at the start of a line will not trigger such a block
if, for instance, you wanted tabs to trigger indented code blocks, then set tab_width to 4:
rd = base.RightDown.From(thing, tab_width=4)
alternately, you could turn off indented code blocks completely:
rd = base.RightDown.From(thing, indented_code_width=0)
see the top of class Parser in parser.py for an authoritative list of all options
all markdown libraries get to choose what language bits to have and what to leave out. headers, block quotes, and links? all pretty normal. paragraph alignment? not so common
rightdown is just a dialect of markdown, in that all standard markdown is supported. we also include some non-standard extensions, such as paragraph alignment, blank lines, soft breaks, etc.
many details are explored in the following example documents:
a description of the library’s internal implementation is available here
please write to us with any comments, questions, or criticisms:
thank you so much