{"id":13423447,"url":"https://github.com/r-lib/commonmark","last_synced_at":"2025-04-06T03:07:50.644Z","repository":{"id":32603344,"uuid":"36187791","full_name":"r-lib/commonmark","owner":"r-lib","description":"High Performance CommonMark and Github Markdown Rendering in R","archived":false,"fork":false,"pushed_at":"2025-03-22T19:43:01.000Z","size":829,"stargazers_count":93,"open_issues_count":12,"forks_count":12,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-30T02:05:39.944Z","etag":null,"topics":["cmark","cmark-gfm","gfm","markdown"],"latest_commit_sha":null,"homepage":"https://docs.ropensci.org/commonmark/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r-lib.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-24T18:58:14.000Z","updated_at":"2025-03-22T19:43:05.000Z","dependencies_parsed_at":"2024-01-30T12:26:30.359Z","dependency_job_id":"5e62e5b2-9619-4b8b-85b2-4ecb2289c2a0","html_url":"https://github.com/r-lib/commonmark","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fcommonmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fcommonmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fcommonmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fcommonmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-lib","download_url":"https://codeload.github.com/r-lib/commonmark/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247427006,"owners_count":20937201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmark","cmark-gfm","gfm","markdown"],"created_at":"2024-07-31T00:00:34.793Z","updated_at":"2025-04-06T03:07:50.626Z","avatar_url":"https://github.com/r-lib.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# commonmark\n\n\u003e High Performance CommonMark and Github Markdown Rendering in R\n\n[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/commonmark)](https://cran.r-project.org/package=commonmark)\n[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/commonmark)](https://cran.r-project.org/package=commonmark)\n\nThe CommonMark specification defines a rationalized version of markdown\nsyntax. This package uses the 'cmark' reference implementation for converting\nmarkdown text into various formats including html, latex and groff man. In\naddition it exposes the markdown parse tree in xml format. The latest version of\nthis package also adds support for Github extensions including tables, autolinks\nand strikethrough text.\n\n## Documentation\n\n - [The `commonmark` R package](https://docs.ropensci.org/commonmark/)\n - [CommonMark specification for Markdown text](https://commonmark.org/help/)\n - [Extensions for GitHub Flavored Markdown](https://github.github.com/gfm/)\n\n## Basic Markdown\n\n\n```r\nlibrary(commonmark)\nmd \u003c- \"## Test\nAn *example* text for the `commonmark` package.\"\n\n# Convert to Latex\ncat(markdown_latex(md))\n```\n\n```\n\\subsection{Test}\n\nAn \\emph{example} text for the \\texttt{commonmark} package.\n```\n\n```r\n# Convert to HTML\ncat(markdown_html(md))\n```\n\n```\n\u003ch2\u003eTest\u003c/h2\u003e\n\u003cp\u003eAn \u003cem\u003eexample\u003c/em\u003e text for the \u003ccode\u003ecommonmark\u003c/code\u003e package.\u003c/p\u003e\n```\n\n```r\n# Convert to 'groff' man \ncat(markdown_man(md))\n```\n\n```\n.SS\nTest\n.PP\nAn \\f[I]example\\f[] text for the \\f[C]commonmark\\f[] package.\n```\n\n```r\n# Convert back to (normalized) markdown\ncat(markdown_commonmark(md))\n```\n\n```\n## Test\n\nAn *example* text for the `commonmark` package.\n```\n\n```r\n# The markdown parse tree\ncat(markdown_xml(md))\n```\n\n```\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003c!DOCTYPE document SYSTEM \"CommonMark.dtd\"\u003e\n\u003cdocument xmlns=\"http://commonmark.org/xml/1.0\"\u003e\n  \u003cheading level=\"2\"\u003e\n    \u003ctext\u003eTest\u003c/text\u003e\n  \u003c/heading\u003e\n  \u003cparagraph\u003e\n    \u003ctext\u003eAn \u003c/text\u003e\n    \u003cemph\u003e\n      \u003ctext\u003eexample\u003c/text\u003e\n    \u003c/emph\u003e\n    \u003ctext\u003e text for the \u003c/text\u003e\n    \u003ccode\u003ecommonmark\u003c/code\u003e\n    \u003ctext\u003e package.\u003c/text\u003e\n  \u003c/paragraph\u003e\n\u003c/document\u003e\n```\n\n## Github Extensions\n\nCommonmark 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:\n\n - __table__ support rendering of tables\n - __strikethough__ via `~sometext~` syntax\n - __autolink__ automatically turn URLs into hyperlinks\n - __tagfilter__ blacklist html tags: `title` `textarea` `style` `xmp` `iframe` `noembed` `noframes` `script` `plaintext`.\n - __tasklist__ turns certain list items into checkboxes\n \nThese extensions were added by Github to support [GitHub Flavored Markdown](https://github.github.com/gfm/).\n\n\n```r\ntable \u003c- '\naaa | bbb | ccc | ddd | eee\n:-- | --- | :-: | --- | --:\nfff | ggg | hhh | iii | jjj'\n\ncat(markdown_latex(table, extensions = TRUE))\n```\n\n```\n\\begin{table}\n\\begin{tabular}{llclr}\naaa \u0026 bbb \u0026 ccc \u0026 ddd \u0026 eee \\\\\nfff \u0026 ggg \u0026 hhh \u0026 iii \u0026 jjj \\\\\n\\end{tabular}\n\\end{table}\n```\n\n```r\ncat(markdown_html(table, extensions = TRUE))\n```\n\n```\n\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth align=\"left\"\u003eaaa\u003c/th\u003e\n\u003cth\u003ebbb\u003c/th\u003e\n\u003cth align=\"center\"\u003eccc\u003c/th\u003e\n\u003cth\u003eddd\u003c/th\u003e\n\u003cth align=\"right\"\u003eeee\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd align=\"left\"\u003efff\u003c/td\u003e\n\u003ctd\u003eggg\u003c/td\u003e\n\u003ctd align=\"center\"\u003ehhh\u003c/td\u003e\n\u003ctd\u003eiii\u003c/td\u003e\n\u003ctd align=\"right\"\u003ejjj\u003c/td\u003e\n\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-lib%2Fcommonmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-lib%2Fcommonmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-lib%2Fcommonmark/lists"}