All Projects → r-lib → commonmark

r-lib / commonmark

Licence: other
High Performance CommonMark and Github Markdown Rendering in R

Programming Languages

c
50402 projects - #5 most used programming language
C++
36643 projects - #6 most used programming language
r
7636 projects

Projects that are alternatives of or similar to commonmark

Markdown
A super fast, highly extensible markdown parser for PHP
Stars: ✭ 945 (+1111.54%)
Mutual labels:  gfm
Showdown
A bidirectional Markdown to HTML to Markdown converter written in Javascript
Stars: ✭ 12,137 (+15460.26%)
Mutual labels:  gfm
Markdig
A fast, powerful, CommonMark compliant, extensible Markdown processor for .NET
Stars: ✭ 2,730 (+3400%)
Mutual labels:  gfm
Markd
Yet another markdown parser, Compliant to CommonMark specification, written in Crystal.
Stars: ✭ 73 (-6.41%)
Mutual labels:  gfm
Hads
📚 Markdown superpowered documentation for Node.js
Stars: ✭ 147 (+88.46%)
Mutual labels:  gfm
Tui.editor
🍞📝 Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.
Stars: ✭ 14,016 (+17869.23%)
Mutual labels:  gfm
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 (+916.67%)
Mutual labels:  gfm
MarkdownSyntax
☄️ A Type-safe Markdown parser in Swift.
Stars: ✭ 65 (-16.67%)
Mutual labels:  cmark
Commonmark
Highly-extensible PHP Markdown parser which fully supports the CommonMark and GFM specs.
Stars: ✭ 2,128 (+2628.21%)
Mutual labels:  gfm
Lute
🎼 一款结构化的 Markdown 引擎,支持 Go 和 JavaScript。
Stars: ✭ 211 (+170.51%)
Mutual labels:  gfm
Remark Github
plugin to autolink references to commits, issues, pull-requests, and users, like on GitHub
Stars: ✭ 83 (+6.41%)
Mutual labels:  gfm
Vditor
♏ 一款浏览器端的 Markdown 编辑器。
Stars: ✭ 1,742 (+2133.33%)
Mutual labels:  gfm
Abricotine
Markdown editor with inline preview
Stars: ✭ 2,308 (+2858.97%)
Mutual labels:  gfm
Markdown To Jsx
🏭 The most lightweight, customizable React markdown component.
Stars: ✭ 1,079 (+1283.33%)
Mutual labels:  gfm
Lute
🎼 一款对中文语境优化的 Markdown 引擎,支持 Go 和 JavaScript。A structured Markdown engine that supports Go and JavaScript.
Stars: ✭ 222 (+184.62%)
Mutual labels:  gfm
React Markdown
Markdown component for React
Stars: ✭ 8,047 (+10216.67%)
Mutual labels:  gfm
Python Markdown Editor
Standalone editor for your markdown files
Stars: ✭ 164 (+110.26%)
Mutual labels:  gfm
Hyde
📝 An Electron powered markdown editor for Jekyll users
Stars: ✭ 44 (-43.59%)
Mutual labels:  gfm
celldown.js
Small javascript library for manipulating markdown tables
Stars: ✭ 17 (-78.21%)
Mutual labels:  gfm
Vditor
♏ 一款浏览器端的 Markdown 编辑器,支持所见即所得(富文本)、即时渲染(类似 Typora)和分屏预览模式。An In-browser Markdown editor, support WYSIWYG (Rich Text), Instant Rendering (Typora-like) and Split View modes.
Stars: ✭ 3,773 (+4737.18%)
Mutual labels:  gfm

commonmark

High Performance CommonMark and Github Markdown Rendering in R

CRAN_Status_Badge CRAN RStudio mirror downloads

The CommonMark specification defines a rationalized version of markdown syntax. This package uses the 'cmark' reference implementation for converting markdown text into various formats including html, latex and groff man. In addition it exposes the markdown parse tree in xml format. The latest version of this package also adds support for Github extensions including tables, autolinks and strikethrough text.

Documentation

Basic Markdown

library(commonmark)
md <- "## Test
An *example* text for the `commonmark` package."

# Convert to Latex
cat(markdown_latex(md))
\subsection{Test}

An \emph{example} text for the \texttt{commonmark} package.
# Convert to HTML
cat(markdown_html(md))
<h2>Test</h2>
<p>An <em>example</em> text for the <code>commonmark</code> package.</p>
# Convert to 'groff' man 
cat(markdown_man(md))
.SS
Test
.PP
An \f[I]example\f[] text for the \f[C]commonmark\f[] package.
# Convert back to (normalized) markdown
cat(markdown_commonmark(md))
## Test

An *example* text for the `commonmark` package.
# The markdown parse tree
cat(markdown_xml(md))
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document SYSTEM "CommonMark.dtd">
<document xmlns="http://commonmark.org/xml/1.0">
  <heading level="2">
    <text>Test</text>
  </heading>
  <paragraph>
    <text>An </text>
    <emph>
      <text>example</text>
    </emph>
    <text> text for the </text>
    <code>commonmark</code>
    <text> package.</text>
  </paragraph>
</document>

Github Extensions

Commonmark includes several 'extensions' to enable features which are not (yet) part of the official specification. The current version of the commonmark R package offers 4 such extensions:

  • table support rendering of tables
  • strikethough via ~sometext~ syntax
  • autolink automatically turn URLs into hyperlinks
  • tagfilter blacklist html tags: title textarea style xmp iframe noembed noframes script plaintext.
  • tasklist turns certain list items into checkboxes

These extensions were added by Github to support GitHub Flavored Markdown.

table <- '
aaa | bbb | ccc | ddd | eee
:-- | --- | :-: | --- | --:
fff | ggg | hhh | iii | jjj'

cat(markdown_latex(table, extensions = TRUE))
\begin{table}
\begin{tabular}{llclr}
aaa & bbb & ccc & ddd & eee \\
fff & ggg & hhh & iii & jjj \\
\end{tabular}
\end{table}
cat(markdown_html(table, extensions = TRUE))
<table>
<thead>
<tr>
<th align="left">aaa</th>
<th>bbb</th>
<th align="center">ccc</th>
<th>ddd</th>
<th align="right">eee</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">fff</td>
<td>ggg</td>
<td align="center">hhh</td>
<td>iii</td>
<td align="right">jjj</td>
</tr></tbody></table>
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].