小笔记:表 - 各种语言的 CommonMark Markdown解析器 实现

简介: 小笔记:表 - 各种语言的 CommonMark Markdown解析器 实现

表:各种语言的 CommonMark Markdown解析器 实现



1. 什么是 CommonMark

Markdown 的作者 John Gruber 对 Markdown 语法的规范描述并没有明确指定语法。在没有规范的情况下,早期的实现者参考了原始代码来解决这些歧义。但是它非常有问题,并且在许多情况下给出了明显不好的结果,因此它不是规格的令人满意的替代品。

由于没有明确的规范,因此在过去 10 年中,实现方式差异很大。因此,用户经常惊讶地发现,在一个系统(例如,GitHub wiki)上以一种方式呈现的文档在另一个系统上呈现方式不同(例如,使用 Pandoc 转换为文档手册)。更糟糕的是,由于 Markdown 中没有任何内容被视为“语法错误”,因此通常不会立即发现分歧。

CommonMark 为 Markdown 提出了一个标准的、明确的语法规范,以及一套全面的测试来验证 Markdown 实现是否符合这个规范。

2. 表:各种语言的 CommonMark Markdown解析器 实现

语言类型 项目名称 项目地址 说明
C cmark https://github.com/commonmark/cmark 是 CommonMark 的 C 参考实现,一个 带有规范的 Markdown 语法的合理化版本
C cmark-gfm https://github.com/github/cmark 是 CommonMark 的 C 参考实现的扩展版本,是带有规范的 Markdown 语法的合理化版本
C MD4C https://github.com/mity/md4c MD4C代表“Markdown for C”,这正是这个项目的意义所在。
C# CommonMark.NET https://github.com/Knagis/CommonMark.NET
C# Markdig https://github.com/lunet-io/markdig
Common Lisp cl-cmark https://gitlab.com/HiPhish/cl-cmark
Crystal markd https://github.com/icyleaf/markd
D commonmark-d https://github.com/p0nce/commonmark-d
D hunt-markdown https://github.com/huntlabs/hunt-markdown
Dart mdown https://github.com/dikmax/mdown 快速且符合CommonMark的Markdown解析器
Elixir Cmark https://github.com/asaaki/cmark.ex
Emacs Lisp cmark https://github.com/taku0/cmark-el
Go golang-commonmark/markdown https://gitlab.com/golang-commonmark/markdown 纯 Go 实现
Go go-commonmark https://github.com/rhinoman/go-commonmark 对C库的封装
Go goldmark https://github.com/yuin/goldmark
Go Lute https://github.com/88250/lute
Haskell cmark http://hackage.haskell.org/package/cmark 对C库的封装
Haskell commonmark-hs https://github.com/jgm/commonmark-hs 纯 Haskell 实现
Haxe necmark https://github.com/ConstNW/necmark 对C库的封装
Java commonmark-java https://github.com/commonmark/commonmark-java 纯Java实现
Java flexmark-java https://github.com/vsch/flexmark-java 纯Java实现,源代码级AST低至单个字符
JavaScript commonmark.js https://github.com/jgm/commonmark.js marked.js 就使用了它实现
JavaScript markdown-it https://github.com/markdown-it/markdown-it
JavaScript cmark-emscripten https://github.com/mvasilkov/cmark-emscripten C 库到 WebAssembly 的接口
JavaScript mdx https://github.com/mdx-js/mdx CommonMark 的超集,添加嵌入式 JSX 和导入/导出语法
JavaScript ciceromark https://github.com/accordproject/markdown-transform
Julia CommonMark.jl https://github.com/MichaelHatherly/CommonMark.jl
Lua cmark-lua https://github.com/jgm/cmark-lua
Lua lcmark https://github.com/jgm/lcmark
Perl CommonMark https://metacpan.org/release/CommonMark
PHP league/commonmark http://commonmark.thephpleague.com/
PHP cmark http://docs.php.net/cmark
Python commonmark.py https://github.com/rtfd/commonmark.py 直接基于commonmark的纯Python实现.js
Python markdown-it-py https://github.com/ExecutableBookProject/markdown-it-py markdown-it 库的纯 Python 版本
Python mistletoe https://github.com/miyuchina/mistletoe 纯 Python 中最快、可扩展的实现
Python paka.cmark https://github.com/PavloKapyshin/paka.cmark 对 C 语言实现的 cmark 的封装
Python Marko https://github.com/frostming/marko 一个纯粹的Python实现,专注于简单的可扩展性
Ruby/RubyMotion CommonMarker https://github.com/gjtorikian/commonmarker 对C库的封装
Ruby/RubyMotion motion-markdown-it https://github.com/digitalmoksha/motion-markdown-it/ 基于 JS markdown-it 库,移植到 Ruby 和 RubyMotion
R commonmark http://cran.r-project.org/package=commonmark 对C库的封装
Racket commonmark https://lexi-lambda.github.io/racket-commonmark/ 原生Racket ,具有完整的测试覆盖率
Rust comrak https://github.com/kivikakk/comrak 基于 cmark-gfm 的架构,带有 GitHub 扩展。
Rust pulldown-cmark https://github.com/google/pulldown-cmark 新颖的、以性能为导向的架构。
Scala cmark-scala https://github.com/sparsetech/cmark-scala
Scheme Down https://github.com/OrangeShark/guile-commonmark/
Swift Down https://github.com/iwasrobbed/Down
Swift SwiftMark https://github.com/Pyroh/SwiftMark 对C库的封装
Swift MarkdownSyntax https://github.com/hebertialmeida/MarkdownSyntax 包装用于 AST 访问的参考 C 库
Tcl tcl-cmark https://github.com/apnadkarni/tcl-cmark
TypeScript DefinitelyTyped https://github.com/DefinitelyTyped/DefinitelyTyped
TypeScript FlavorMark https://github.com/AnyhowStep/flavormark 重写 commonmark.js,专注于模块化解析逻辑
Zig koino https://github.com/kivikakk/koino 基于 Comrak/cmark-gfm 的架构,带有 GitHub 扩展
目录
相关文章
|
24天前
|
存储 缓存 安全
掌握Go语言:Go语言中的字典魔法,高效数据检索与应用实例解析(18)
掌握Go语言:Go语言中的字典魔法,高效数据检索与应用实例解析(18)
|
1月前
|
Go 开发者
Go语言并发模型概览:CSP模型解析
【2月更文挑战第17天】Go语言以其强大的并发处理能力在编程领域崭露头角。其中,CSP(Communicating Sequential Processes)模型作为Go语言并发模型的核心之一,在并发编程中发挥着至关重要的作用。本文将深入解析CSP模型的基本原理及其在Go语言中的应用,帮助读者更好地理解Go语言的并发编程特性。
|
1月前
|
存储 缓存 安全
Go语言内存模型深度解析
【2月更文挑战第16天】Go语言以其简洁的语法、强大的并发编程能力和高效的内存管理而备受开发者青睐。本文将对Go语言的内存模型进行深度解析,探讨其内存布局、内存分配与回收机制以及内存安全等方面的内容,帮助读者更好地理解和应用Go语言的内存管理特性。
|
2月前
|
Android开发
我用过的笔记 Markdown Wiki 工具
我用过的笔记 Markdown Wiki 工具
|
24天前
|
存储 安全 Go
掌握Go语言:Go语言类型转换,无缝处理数据类型、接口和自定义类型的转换细节解析(29)
掌握Go语言:Go语言类型转换,无缝处理数据类型、接口和自定义类型的转换细节解析(29)
|
1天前
|
开发框架 Dart Java
Flutter的核心:Dart语言基础——语法与特性深度解析
【4月更文挑战第26天】Flutter框架背后的Dart语言,以其简洁的语法和独特特性深受开发者喜爱。本文深入解析Dart的语法与特性,如类型推导、动态静态类型系统、统一的类接口、访问权限控制以及并发编程支持。了解并掌握Dart,能助开发者更高效地利用Flutter构建高性能移动应用。
|
2天前
|
人工智能 Go 调度
掌握Go并发:Go语言并发编程深度解析
掌握Go并发:Go语言并发编程深度解析
|
1月前
|
存储 缓存 编译器
Go语言解析Tag:深入探究实现原理
【2月更文挑战第20天】
42 2
|
1月前
|
安全 Go 开发者
Go语言中的反射机制深度解析
【2月更文挑战第19天】Go语言的反射机制提供了一种在运行时检查对象类型、获取和设置对象字段、调用对象方法的能力。本文通过深入解析Go语言反射机制的核心概念、使用方法和注意事项,帮助读者更好地理解和应用这一强大而灵活的工具。
|
2月前
|
数据采集 安全 API
如何实时获取小红书笔记详情的API使用与解析
小红书是一个以分享消费经验、生活方式为主的社交平台,拥有大量的用户和内容。为了更好地了解用户在小红书上的行为和内容,许多开发者选择使用小红书开放平台提供的API接口。本文将介绍如何通过小红书笔记详情API实现实时数据获取,并给出相应的代码示例。

推荐镜像

更多