All Projects → frostming → Marko

frostming / Marko

Licence: mit
A markdown parser with high extensibility.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Marko

Elm Markdown
Pure Elm markdown parsing and rendering
Stars: ✭ 96 (+24.68%)
Mutual labels:  markdown, parser, commonmark
Remarkable
Markdown parser, done right. Commonmark support, extensions, syntax plugins, high speed - all in one. Gulp and metalsmith plugins available. Used by Facebook, Docusaurus and many others! Use https://github.com/breakdance/breakdance for HTML-to-markdown conversion. Use https://github.com/jonschlinkert/markdown-toc to generate a table of contents.
Stars: ✭ 5,252 (+6720.78%)
Mutual labels:  markdown, parser, commonmark
Commonmark Java
Java library for parsing and rendering CommonMark (Markdown)
Stars: ✭ 1,675 (+2075.32%)
Mutual labels:  markdown, parser, commonmark
Marked
A markdown parser and compiler. Built for speed.
Stars: ✭ 26,556 (+34388.31%)
Mutual labels:  markdown, parser, commonmark
Md4c
C Markdown parser. Fast. SAX-like interface. Compliant to CommonMark specification.
Stars: ✭ 322 (+318.18%)
Mutual labels:  markdown, parser, commonmark
Comrak
CommonMark + GFM compatible Markdown parser and renderer
Stars: ✭ 444 (+476.62%)
Mutual labels:  markdown, commonmark
Awesome Markdown
📝 Delightful Markdown stuff.
Stars: ✭ 451 (+485.71%)
Mutual labels:  markdown, commonmark
React Markdown Editor Lite
a light-weight Markdown editor based on React. 一款轻量的基于React的markdown编辑器
Stars: ✭ 553 (+618.18%)
Mutual labels:  markdown, parser
Ngx Markdown
Angular markdown component/directive/pipe/service to parse static, dynamic or remote content to HTML with syntax highlight
Stars: ✭ 687 (+792.21%)
Mutual labels:  markdown, parser
Markdown Writer Fx
Markdown Writer FX
Stars: ✭ 323 (+319.48%)
Mutual labels:  markdown, commonmark
Turndown
🛏 An HTML to Markdown converter written in JavaScript
Stars: ✭ 5,991 (+7680.52%)
Mutual labels:  markdown, commonmark
Micromark
the smallest commonmark compliant markdown parser that exists; new basis for @unifiedjs (hundreds of projects w/ billions of downloads for dealing w/ content)
Stars: ✭ 793 (+929.87%)
Mutual labels:  markdown, commonmark
Breakdance
It's time for your markup to get down! HTML to markdown converter. Breakdance is a highly pluggable, flexible and easy to use.
Stars: ✭ 418 (+442.86%)
Mutual labels:  markdown, commonmark
Remark
remark is a popular tool that transforms markdown with plugins. These plugins can inspect and change your markup. You can use remark on the server, the client, CLIs, deno, etc.
Stars: ✭ 4,746 (+6063.64%)
Mutual labels:  markdown, commonmark
Commonmarkattributedstring
Create NSAttributedStrings from Markdown Text
Stars: ✭ 382 (+396.1%)
Mutual labels:  markdown, commonmark
Qlcommonmark
QuickLook generator for beautifully rendering CommonMark documents on macOS
Stars: ✭ 36 (-53.25%)
Mutual labels:  markdown, commonmark
React Markdown
Markdown component for React
Stars: ✭ 8,047 (+10350.65%)
Mutual labels:  markdown, commonmark
Parsedown Extra Plugin
Configurable Markdown to HTML converter with Parsedown Extra Plugin.
Stars: ✭ 47 (-38.96%)
Mutual labels:  markdown, parser
Craftinginterpreters
Repository for the book "Crafting Interpreters"
Stars: ✭ 4,298 (+5481.82%)
Mutual labels:  markdown, parser
Markra
A Markdown-to-JIRA syntax editor.
Stars: ✭ 64 (-16.88%)
Mutual labels:  markdown, commonmark

𝓜𝓪𝓻𝓴𝓸

A markdown parser with high extensibility.

PyPI PyPI - Python Version Documentation Status CommonMark Spec

Build Status codecov Codacy Badge

Marko is a markdown parser written in pure Python that complies CommonMark's spec v0.29. It is designed to be highly extensible, see Extend Marko for details.

Marko requires Python 3.6 or higher.

Why Marko

Among all implementations of Python's markdown parser, it is a common issue that user can't easily extend it to add his own features. Furthermore, Python-Markdown and mistune don't comply CommonMark's spec. It is a good reason for me to develop a new markdown parser.

Respecting that Marko complies CommonMark's spec at the same time, which is a super complicated spec, Marko's performance will be affected. However, using a parser which doesn't comply the CommonMark spec may give you unexpected rendered results from time to time. A benchmark result shows that Marko is 3 times slower than Python-Markdown, but a bit faster than Commonmark-py, much slower than mistune. If performance is a bigger concern to you than spec compliance, you'd better choose another parser.

Use Marko

The installation is very simple:

$ pip install marko

And to use it:

import marko

print(marko.convert(text))

Marko also provides a simple CLI, for example, to render a document and output to a html file:

$ cat my_article.md | marko > my_article.html

Extensions

It is super easy to use an extension:

from marko import Markdown
from marko.ext.footnote import Footnote
# Add footnote extension
markdown = Markdown(extensions=[Footnote])
# Or you can just:
markdown = Markdown(extensions=['footnote'])
# Alternatively you can register an extension later
markdown.use(Footnote)

An example of using an extension with the command-line version of Marko:

$ cat this_has_footnote.txt | marko -e footnote > hi_world.html

Marko is shipped with 4 extensions: 'footnote', 'toc' 'pangu', 'codehilite'. They are not included in CommonMark's spec but are common in other markdown parsers.

Marko also provides a Github flavored markdown parser which can be found at marko.ext.gfm.gfm.

Please refer to Extend Marko about how to write your own extension.

License

Marko is released under MIT License

Change Log

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].