Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.md 26KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737
  1. <h1 align="center">
  2. <img src="https://raw.githubusercontent.com/micromark/micromark/9c34547/logo.svg?sanitize=true" alt="micromark" width="400" />
  3. </h1>
  4. [![Build][build-badge]][build]
  5. [![Coverage][coverage-badge]][coverage]
  6. [![Downloads][downloads-badge]][downloads]
  7. [![Size][bundle-size-badge]][bundle-size]
  8. [![Sponsors][sponsors-badge]][opencollective]
  9. [![Backers][backers-badge]][opencollective]
  10. [![Chat][chat-badge]][chat]
  11. The smallest CommonMark compliant markdown parser with positional info and
  12. concrete tokens.
  13. * [x] **[compliant][commonmark]** (100% to CommonMark)
  14. * [x] **[extensions][]** ([GFM][], [directives][], [footnotes][],
  15. [frontmatter][], [math][], [MDX.js][mdxjs])
  16. * [x] **[safe][security]** (by default)
  17. * [x] **[small][size]** (smallest CM parser that exists)
  18. * [x] **[robust][test]** (1800+ tests, 100% coverage, fuzz testing)
  19. ## Intro
  20. micromark is a long awaited markdown parser.
  21. It uses a [state machine][cmsm] to parse the entirety of markdown into concrete
  22. tokens.
  23. It’s the smallest 100% [CommonMark][] compliant markdown parser in JavaScript.
  24. It was made to replace the internals of [`remark-parse`][remark-parse], the most
  25. [popular][] markdown parser.
  26. Its API compiles to HTML, but its parts are made to be used separately, so as to
  27. generate syntax trees ([`mdast-util-from-markdown`][from-markdown]) or compile
  28. to other output formats.
  29. It’s in open beta: up next are [CMSM][] and CSTs.
  30. * for updates, see [Twitter][]
  31. * for more about us, see [`unifiedjs.com`][site]
  32. * for questions, see [Discussions][chat]
  33. * to help, see [contribute][] or [sponsor][] below
  34. ## Contents
  35. * [Install](#install)
  36. * [Use](#use)
  37. * [API](#api)
  38. * [`micromark(doc[, encoding][, options])`](#micromarkdoc-encoding-options)
  39. * [`micromarkStream(options?)`](#micromarkstreamoptions)
  40. * [Extensions](#extensions)
  41. * [`SyntaxExtension`](#syntaxextension)
  42. * [`HtmlExtension`](#htmlextension)
  43. * [List of extensions](#list-of-extensions)
  44. * [Syntax tree](#syntax-tree)
  45. * [CommonMark](#commonmark)
  46. * [Grammar](#grammar)
  47. * [Test](#test)
  48. * [Size & debug](#size--debug)
  49. * [Comparison](#comparison)
  50. * [Version](#version)
  51. * [Security](#security)
  52. * [Contribute](#contribute)
  53. * [Sponsor](#sponsor)
  54. * [Origin story](#origin-story)
  55. * [License](#license)
  56. ## Install
  57. [npm][]:
  58. ```sh
  59. npm install micromark
  60. ```
  61. ## Use
  62. Typical use (buffering):
  63. ```js
  64. var micromark = require('micromark')
  65. console.log(micromark('## Hello, *world*!'))
  66. ```
  67. Yields:
  68. ```html
  69. <h2>Hello, <em>world</em>!</h2>
  70. ```
  71. The same can be done with ESM (in Node 10+, browsers that support it, or with a
  72. bundler), in an `example.mjs` file, like so:
  73. ```js
  74. import micromark from 'micromark'
  75. console.log(micromark('## Hello, *world*!'))
  76. ```
  77. You can pass extensions (in this case [`micromark-extension-gfm`][gfm]):
  78. ```js
  79. var micromark = require('micromark')
  80. var gfmSyntax = require('micromark-extension-gfm')
  81. var gfmHtml = require('micromark-extension-gfm/html')
  82. var doc = '* [x] contact@example.com ~~strikethrough~~'
  83. var result = micromark(doc, {
  84. extensions: [gfmSyntax()],
  85. htmlExtensions: [gfmHtml]
  86. })
  87. console.log(result)
  88. ```
  89. Yields:
  90. ```html
  91. <ul>
  92. <li><input checked="" disabled="" type="checkbox"> <a href="mailto:contact@example.com">contact@example.com</a> <del>strikethrough</del></li>
  93. </ul>
  94. ```
  95. Streaming interface:
  96. ```js
  97. var fs = require('fs')
  98. var micromarkStream = require('micromark/stream')
  99. fs.createReadStream('example.md')
  100. .on('error', handleError)
  101. .pipe(micromarkStream())
  102. .pipe(process.stdout)
  103. function handleError(err) {
  104. // Handle your error here!
  105. throw err
  106. }
  107. ```
  108. ## API
  109. This section documents the API.
  110. The parts can be used separately, but this isn’t documented yet.
  111. ### `micromark(doc[, encoding][, options])`
  112. Compile markdown to HTML.
  113. ##### Parameters
  114. ###### `doc`
  115. Markdown to parse (`string` or `Buffer`)
  116. ###### `encoding`
  117. [Character encoding][encoding] to understand `doc` as when it’s a
  118. [`Buffer`][buffer] (`string`, default: `'utf8'`).
  119. ###### `options.defaultLineEnding`
  120. Value to use for line endings not in `doc` (`string`, default: first line
  121. ending or `'\n'`).
  122. Generally, micromark copies line endings (`'\r'`, `'\n'`, `'\r\n'`) in the
  123. markdown document over to the compiled HTML.
  124. In some cases, such as `> a`, CommonMark requires that extra line endings are
  125. added: `<blockquote>\n<p>a</p>\n</blockquote>`.
  126. ###### `options.allowDangerousHtml`
  127. Whether to allow embedded HTML (`boolean`, default: `false`).
  128. ###### `options.allowDangerousProtocol`
  129. Whether to allow potentially dangerous protocols in links and images (`boolean`,
  130. default: `false`).
  131. URLs relative to the current protocol are always allowed (such as, `image.jpg`).
  132. For links, the allowed protocols are `http`, `https`, `irc`, `ircs`, `mailto`,
  133. and `xmpp`.
  134. For images, the allowed protocols are `http` and `https`.
  135. ###### `options.extensions`
  136. Array of syntax extensions ([`Array.<SyntaxExtension>`][syntax-extension],
  137. default: `[]`).
  138. ###### `options.htmlExtensions`
  139. Array of HTML extensions ([`Array.<HtmlExtension>`][html-extension], default:
  140. `[]`).
  141. ##### Returns
  142. `string` — Compiled HTML.
  143. ### `micromarkStream(options?)`
  144. Streaming interface of micromark.
  145. Compiles markdown to HTML.
  146. `options` are the same as the buffering API above.
  147. Available at `require('micromark/stream')`.
  148. Note that some of the work to parse markdown can be done streaming, but in the
  149. end buffering is required.
  150. micromark does not handle errors for you, so you must handle errors on whatever
  151. streams you pipe into it.
  152. As markdown does not know errors, `micromark` itself does not emit errors.
  153. ## Extensions
  154. There are two types of extensions for micromark:
  155. [`SyntaxExtension`][syntax-extension] and [`HtmlExtension`][html-extension].
  156. They can be passed in [`extensions`][option-extensions] or
  157. [`htmlExtensions`][option-htmlextensions], respectively.
  158. ### `SyntaxExtension`
  159. A syntax extension is an object whose fields are the names of hooks, referring
  160. to where constructs “hook” into.
  161. `content` (a block of, well, content: definitions and paragraphs), `document`
  162. (containers such as block quotes and lists), `flow` (block constructs such as
  163. ATX and setext headings, HTML, indented and fenced code, thematic breaks),
  164. `string` (things that work in a few places such as destinations, fenced code
  165. info, etc: character escapes and -references), or `text` (rich inline text:
  166. autolinks, character escapes and -references, code, hard breaks, HTML, images,
  167. links, emphasis, strong).
  168. The fields at such objects are character codes, mapping to constructs as values.
  169. The built in [constructs][] are an extension.
  170. See it and the [existing extensions][extensions] for inspiration.
  171. ### `HtmlExtension`
  172. An HTML extension is an object whose fields are either `enter` or `exit`
  173. (reflecting whether a token is entered or exited).
  174. The values at such objects are names of tokens mapping to handlers.
  175. See the [existing extensions][extensions] for inspiration.
  176. ### List of extensions
  177. * [`micromark/micromark-extension-directive`][directives]
  178. — support directives (generic extensions)
  179. * [`micromark/micromark-extension-footnote`][footnotes]
  180. — support footnotes
  181. * [`micromark/micromark-extension-frontmatter`][frontmatter]
  182. — support frontmatter (YAML, TOML, etc)
  183. * [`micromark/micromark-extension-gfm`][gfm]
  184. — support GFM (GitHub Flavored Markdown)
  185. * [`micromark/micromark-extension-gfm-autolink-literal`](https://github.com/micromark/micromark-extension-gfm-autolink-literal)
  186. — support GFM autolink literals
  187. * [`micromark/micromark-extension-gfm-strikethrough`](https://github.com/micromark/micromark-extension-gfm-strikethrough)
  188. — support GFM strikethrough
  189. * [`micromark/micromark-extension-gfm-table`](https://github.com/micromark/micromark-extension-gfm-table)
  190. — support GFM tables
  191. * [`micromark/micromark-extension-gfm-tagfilter`](https://github.com/micromark/micromark-extension-gfm-tagfilter)
  192. — support GFM tagfilter
  193. * [`micromark/micromark-extension-gfm-task-list-item`](https://github.com/micromark/micromark-extension-gfm-task-list-item)
  194. — support GFM tasklists
  195. * [`micromark/micromark-extension-math`][math]
  196. — support math
  197. * [`micromark/micromark-extension-mdx`](https://github.com/micromark/micromark-extension-mdx)
  198. — support MDX
  199. * [`micromark/micromark-extension-mdxjs`][mdxjs]
  200. — support MDX.js
  201. * [`micromark/micromark-extension-mdx-expression`](https://github.com/micromark/micromark-extension-mdx-expression)
  202. — support MDX (or MDX.js) expressions
  203. * [`micromark/micromark-extension-mdx-jsx`](https://github.com/micromark/micromark-extension-mdx-jsx)
  204. — support MDX (or MDX.js) JSX
  205. * [`micromark/micromark-extension-mdx-md`](https://github.com/micromark/micromark-extension-mdx-md)
  206. — support misc MDX changes
  207. * [`micromark/micromark-extension-mdxjs-esm`](https://github.com/micromark/micromark-extension-mdxjs-esm)
  208. — support MDX.js import/exports
  209. ## Syntax tree
  210. A higher level project, [`mdast-util-from-markdown`][from-markdown], can give
  211. you an AST.
  212. ```js
  213. var fromMarkdown = require('mdast-util-from-markdown')
  214. var result = fromMarkdown('## Hello, *world*!')
  215. console.log(result.children[0])
  216. ```
  217. Yields:
  218. ```js
  219. {
  220. type: 'heading',
  221. depth: 2,
  222. children: [
  223. {type: 'text', value: 'Hello, ', position: [Object]},
  224. {type: 'emphasis', children: [Array], position: [Object]},
  225. {type: 'text', value: '!', position: [Object]}
  226. ],
  227. position: {
  228. start: {line: 1, column: 1, offset: 0},
  229. end: {line: 1, column: 19, offset: 18}
  230. }
  231. }
  232. ```
  233. Another level up is [**remark**][remark], which provides a nice interface and
  234. hundreds of plugins.
  235. ## CommonMark
  236. The first definition of “Markdown” gave several examples of how it worked,
  237. showing input Markdown and output HTML, and came with a reference implementation
  238. (`Markdown.pl`).
  239. When new implementations followed, they mostly followed the first definition,
  240. but deviated from the first implementation, and added extensions, thus making
  241. the format a family of formats.
  242. Some years later, an attempt was made to standardize the differences between
  243. implementations, by specifying how several edge cases should be handled, through
  244. more input and output examples.
  245. This is known as [CommonMark][commonmark-spec], and many implementations now
  246. work towards some degree of CommonMark compliancy.
  247. Still, CommonMark describes what the output in HTML should be given some
  248. input, which leaves many edge cases up for debate, and does not answer what
  249. should happen for other output formats.
  250. micromark passes all tests from CommonMark and has many more tests to match the
  251. CommonMark reference parsers.
  252. Finally, it comes with [CMSM][], which describes how to parse markup, instead
  253. of documenting input and output examples.
  254. ## Grammar
  255. The syntax of markdown can be described in Backus–Naur form (BNF) as:
  256. ```bnf
  257. markdown = .*
  258. ```
  259. No, that’s not a [typo](http://trevorjim.com/a-specification-for-markdown/):
  260. markdown has no syntax errors; anything thrown at it renders *something*.
  261. ## Test
  262. micromark is tested with the \~650 CommonMark tests and more than 1.2k extra
  263. tests confirmed with CM reference parsers.
  264. These tests reach all branches in the code, thus this project has 100% coverage.
  265. Finally, we use fuzz testing to ensure micromark is stable, reliable, and
  266. secure.
  267. To build, format, and test the codebase, use `$ npm test` after clone and
  268. install.
  269. The `$ npm run test-api` and `$ npm run test-coverage` scripts check the unit
  270. tests and their coverage, respectively.
  271. The `$ npm run test-types` script checks TypeScript definitions.
  272. The `$ npm run test-fuzz` script does fuzz testing for 15 minutes.
  273. The timeout is provided by GNU coreutils **timeout(1)**, which might not be
  274. available on your system.
  275. Either install it or remove it from the script.
  276. ## Size & debug
  277. micromark is really small.
  278. A ton of time went into making sure it minifies well, by the way code is written
  279. but also through custom build scripts to pre-evaluate certain expressions.
  280. Furthermore, care went into making it compress well with GZip and Brotli.
  281. Normally, you’ll use the pre-evaluated version of micromark, which is published
  282. in the `dist/` folder and has entries in the root.
  283. While developing or debugging, you can switch to use the source, which is
  284. published in the `lib/` folder, and comes instrumented with assertions and debug
  285. messages.
  286. To see debug messages, run your script with a `DEBUG` env variable, such as with
  287. `DEBUG="micromark" node script.js`.
  288. To generate the codebase, use `$ npm run generate` after clone and install.
  289. The `$ npm run generate-dist` script specifically takes `lib/` and generates
  290. `dist/`.
  291. The `$ npm run generate-size` script checks the bundle size of `dist/`.
  292. ## Comparison
  293. There are many other markdown parsers out there, and maybe they’re better suited
  294. to your use case!
  295. Here is a short comparison of a couple of ’em in JavaScript.
  296. Note that this list is made by the folks who make `micromark` and `remark`, so
  297. there is some bias.
  298. **Note**: these are, in fact, not really comparable: micromark (and remark)
  299. focus on completely different things than other markdown parsers do.
  300. Sure, you can generate HTML from markdown with them, but micromark (and remark)
  301. are created for (abstract or concrete) syntax trees—to inspect, transform, and
  302. generate content, so that you can make things like [MDX][], [Prettier][], or
  303. [Gatsby][].
  304. ###### micromark
  305. micromark can be used in two different ways.
  306. It can either be used, optionally with existing extensions, to get HTML pretty
  307. easily.
  308. Or, it can give tremendous power, such as access to all tokens with positional
  309. info, at the cost of being hard to get into.
  310. It’s super small, pretty fast, and has 100% CommonMark compliance.
  311. It has syntax extensions, such as supporting 100% GFM compliance (with
  312. `micromark-extension-gfm`), but they’re rather complex to write.
  313. It’s the newest parser on the block.
  314. If you’re looking for fine grained control, use micromark.
  315. ###### remark
  316. [remark][] is the most popular markdown parser.
  317. It’s built on top of `micromark` and boasts syntax trees.
  318. For an analogy, it’s like if Babel, ESLint, and more, were one project.
  319. It supports the syntax extensions that micromark has (so it’s 100% CM compliant
  320. and can be 100% GFM compliant), but most of the work is done in plugins that
  321. transform or inspect the tree.
  322. Transforming the tree is relatively easy: it’s a JSON object that can be
  323. manipulated directly.
  324. remark is stable, widely used, and extremely powerful for handling complex data.
  325. If you’re looking to inspect or transform lots of content, use [remark][].
  326. ###### marked
  327. [marked][] is the oldest markdown parser on the block.
  328. It’s been around for ages, is battle tested, small, popular, and has a bunch of
  329. extensions, but doesn’t match CommonMark or GFM, and is unsafe by default.
  330. If you have markdown you trust and want to turn it into HTML without a fuss, use
  331. [marked][].
  332. ###### markdown-it
  333. [markdown-it][] is a good, stable, and essentially CommonMark compliant markdown
  334. parser, with (optional) support for some GFM features as well.
  335. It’s used a lot as a direct dependency in packages, but is rather big.
  336. It shines at syntax extensions, where you want to support not just markdown, but
  337. *your* (company’s) version of markdown.
  338. If you’re in Node and have CommonMark-compliant (or funky) markdown and want to
  339. turn it into HTML, use [markdown-it][].
  340. ###### Others
  341. There are lots of other markdown parsers!
  342. Some say they’re small, or fast, or that they’re CommonMark compliant — but
  343. that’s not always true.
  344. This list is not supposed to be exhaustive.
  345. This list of markdown parsers is a snapshot in time of why (not) to use
  346. (alternatives to) `micromark`: they’re all good choices, depending on what your
  347. goals are.
  348. ## Version
  349. The open beta of micromark starts at version `2.0.0` (there was a different
  350. package published on npm as `micromark` before).
  351. micromark will adhere to semver at `3.0.0`.
  352. Use tilde ranges for now: `"micromark": "~2.10.1"`.
  353. ## Security
  354. The typical security aspect discussed for markdown is [cross-site scripting
  355. (XSS)][xss] attacks.
  356. It’s safe to compile markdown to HTML if it does not include embedded HTML nor
  357. uses dangerous protocols in links (such as `javascript:` or `data:`).
  358. micromark is safe by default when embedded HTML or dangerous protocols are used
  359. too, as it encodes or drops them.
  360. Turning on the `allowDangerousHtml` or `allowDangerousProtocol` options for
  361. user-provided markdown opens you up to XSS attacks.
  362. Another aspect is DDoS attacks.
  363. For example, an attacker could throw a 100mb file at micromark, in which case
  364. the JavaScript engine will run out of memory and crash.
  365. It is also possible to crash micromark with smaller payloads, notably when
  366. thousands of links, images, emphasis, or strong are opened but not closed.
  367. It is wise to cap the accepted size of input (500kb can hold a big book) and to
  368. process content in a different thread or worker so that it can be stopped when
  369. needed.
  370. Using extensions might also be unsafe, refer to their documentation for more
  371. information.
  372. For more information on markdown sanitation, see
  373. [`improper-markup-sanitization.md`][improper] by [**@chalker**][chalker].
  374. See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
  375. submit a security report.
  376. ## Contribute
  377. See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
  378. to get started.
  379. See [`support.md`][support] for ways to get help.
  380. This project has a [code of conduct][coc].
  381. By interacting with this repository, organisation, or community you agree to
  382. abide by its terms.
  383. ## Sponsor
  384. Support this effort and give back by sponsoring on [OpenCollective][]!
  385. <table>
  386. <tr valign="middle">
  387. <td width="100%" align="center" colspan="10">
  388. <br>
  389. <a href="https://www.salesforce.com">Salesforce</a> 🏅<br><br>
  390. <a href="https://www.salesforce.com"><img src="https://images.opencollective.com/salesforce/ca8f997/logo/512.png" width="256"></a>
  391. </td>
  392. </tr>
  393. <tr valign="middle">
  394. <td width="20%" align="center" colspan="2">
  395. <a href="https://www.gatsbyjs.org">Gatsby</a> 🥇<br><br>
  396. <a href="https://www.gatsbyjs.org"><img src="https://avatars1.githubusercontent.com/u/12551863?s=256&v=4" width="128"></a>
  397. </td>
  398. <td width="20%" align="center" colspan="2">
  399. <a href="https://vercel.com">Vercel</a> 🥇<br><br>
  400. <a href="https://vercel.com"><img src="https://avatars1.githubusercontent.com/u/14985020?s=256&v=4" width="128"></a>
  401. </td>
  402. <td width="20%" align="center" colspan="2">
  403. <a href="https://www.netlify.com">Netlify</a><br><br>
  404. <!--OC has a sharper image-->
  405. <a href="https://www.netlify.com"><img src="https://images.opencollective.com/netlify/4087de2/logo/256.png" width="128"></a>
  406. </td>
  407. <td width="10%" align="center">
  408. <a href="https://www.holloway.com">Holloway</a><br><br>
  409. <a href="https://www.holloway.com"><img src="https://avatars1.githubusercontent.com/u/35904294?s=128&v=4" width="64"></a>
  410. </td>
  411. <td width="10%" align="center">
  412. <a href="https://themeisle.com">ThemeIsle</a><br><br>
  413. <a href="https://themeisle.com"><img src="https://avatars1.githubusercontent.com/u/58979018?s=128&v=4" width="64"></a>
  414. </td>
  415. <td width="10%" align="center">
  416. <a href="https://boosthub.io">Boost Hub</a><br><br>
  417. <a href="https://boosthub.io"><img src="https://images.opencollective.com/boosthub/6318083/logo/128.png" width="64"></a>
  418. </td>
  419. <td width="10%" align="center">
  420. <a href="https://expo.io">Expo</a><br><br>
  421. <a href="https://expo.io"><img src="https://avatars1.githubusercontent.com/u/12504344?s=128&v=4" width="64"></a>
  422. </td>
  423. </tr>
  424. <tr valign="middle">
  425. <td width="100%" align="center" colspan="10">
  426. <br>
  427. <a href="https://opencollective.com/unified"><strong>You?</strong></a>
  428. <br><br>
  429. </td>
  430. </tr>
  431. </table>
  432. ## Origin story
  433. Over the summer of 2018, micromark was planned, and the idea shared in August
  434. with a couple of friends and potential sponsors.
  435. The problem I (**[@wooorm][]**) had was that issues were piling up in remark and
  436. other repos, but my day job (teaching) was fun, fulfilling, and deserved time
  437. too.
  438. It was getting hard to combine the two.
  439. The thought was to feed two birds with one scone: fix the issues in remark with
  440. a new markdown parser (codename marydown) while being financially supported by
  441. sponsors building fancy stuff on top, such as Gatsby, Contentful, and Vercel
  442. (ZEIT at the time).
  443. **[@johno][]** was making MDX on top of remark at the time (important historical
  444. note: several other folks were working on JSX + markdown too).
  445. We bundled our strengths: MDX was getting some traction and we thought together
  446. we could perhaps make something sustainable.
  447. In November 2018, we launched with the idea for micromark to solve all existing
  448. bugs, sustaining the existing hundreds of projects, and furthering the exciting
  449. high-level project MDX.
  450. We pushed a single name: unified (which back then was a small but essential
  451. part of the chain).
  452. Gatsby and Vercel were immediate sponsors.
  453. We didn’t know whether it would work, and it worked.
  454. But now you have a new problem: you are getting some financial support (much
  455. more than other open source projects) but it’s not enough money for rent, and
  456. too much money to print stickers with.
  457. You still have your job and issues are still piling up.
  458. At the start of summer 2019, after a couple months of saving up donations, I
  459. quit my job and worked on unified through fall.
  460. That got the number of open issues down significantly and set up a strong
  461. governance and maintenance system for the collective.
  462. But when the time came to work on micromark, the money was gone again, so I
  463. contracted through winter 2019, and in spring 2020 I could do about half open
  464. source, half contracting.
  465. One of the contracting gigs was to write a new MDX parser, for which I also
  466. documented how to do that with a state machine [in prose][mdx-cmsm].
  467. That gave me the insight into how the same could be done for markdown: I drafted
  468. [CMSM][], which was some of the core ideas for micromark, but in prose.
  469. In May 2020, Salesforce reached out: they saw the bugs in remark, how micromark
  470. could help, and the initial work on CMSM.
  471. And they had thousands of Markdown files.
  472. In a for open source uncharacteristic move, they decided to fund my work on
  473. micromark.
  474. A large part of what maintaining open source means, is putting out fires,
  475. triaging issues, and making sure users and sponsors are happy, so it was
  476. amazing to get several months to just focus and make something new.
  477. I remember feeling that this project would probably be the hardest thing I’d
  478. work on: yeah, parsers are pretty difficult, but markdown is on another level.
  479. Markdown is such a giant stack of edge cases on edge cases on even more
  480. weirdness, what a mess.
  481. On August 20, 2020, I released [2.0.0][200], the first working version of
  482. micromark.
  483. And it’s hard to describe how that moment felt.
  484. It was great.
  485. ## License
  486. [MIT][license] © [Titus Wormer][author]
  487. <!-- Definitions -->
  488. [build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg
  489. [build]: https://github.com/micromark/micromark/actions
  490. [coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg
  491. [coverage]: https://codecov.io/github/micromark/micromark
  492. [downloads-badge]: https://img.shields.io/npm/dm/micromark.svg
  493. [downloads]: https://www.npmjs.com/package/micromark
  494. [bundle-size-badge]: https://img.shields.io/bundlephobia/minzip/micromark.svg
  495. [bundle-size]: https://bundlephobia.com/result?p=micromark
  496. [sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
  497. [backers-badge]: https://opencollective.com/unified/backers/badge.svg
  498. [opencollective]: https://opencollective.com/unified
  499. [npm]: https://docs.npmjs.com/cli/install
  500. [chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
  501. [chat]: https://github.com/micromark/micromark/discussions
  502. [license]: license
  503. [author]: https://wooorm.com
  504. [health]: https://github.com/micromark/.github
  505. [xss]: https://en.wikipedia.org/wiki/Cross-site_scripting
  506. [securitymd]: https://github.com/micromark/.github/blob/HEAD/security.md
  507. [contributing]: https://github.com/micromark/.github/blob/HEAD/contributing.md
  508. [support]: https://github.com/micromark/.github/blob/HEAD/support.md
  509. [coc]: https://github.com/micromark/.github/blob/HEAD/code-of-conduct.md
  510. [twitter]: https://twitter.com/unifiedjs
  511. [remark]: https://github.com/remarkjs/remark
  512. [site]: https://unifiedjs.com
  513. [contribute]: #contribute
  514. [encoding]: https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings
  515. [buffer]: https://nodejs.org/api/buffer.html
  516. [commonmark-spec]: https://commonmark.org
  517. [popular]: https://www.npmtrends.com/remark-parse-vs-marked-vs-markdown-it
  518. [remark-parse]: https://unifiedjs.com/explore/package/remark-parse/
  519. [improper]: https://github.com/ChALkeR/notes/blob/master/Improper-markup-sanitization.md
  520. [chalker]: https://github.com/ChALkeR
  521. [cmsm]: https://github.com/micromark/common-markup-state-machine
  522. [mdx-cmsm]: https://github.com/micromark/mdx-state-machine
  523. [from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown
  524. [directives]: https://github.com/micromark/micromark-extension-directive
  525. [footnotes]: https://github.com/micromark/micromark-extension-footnote
  526. [frontmatter]: https://github.com/micromark/micromark-extension-frontmatter
  527. [gfm]: https://github.com/micromark/micromark-extension-gfm
  528. [math]: https://github.com/micromark/micromark-extension-math
  529. [mdxjs]: https://github.com/micromark/micromark-extension-mdxjs
  530. [constructs]: lib/constructs.mjs
  531. [extensions]: #list-of-extensions
  532. [syntax-extension]: #syntaxextension
  533. [html-extension]: #htmlextension
  534. [option-extensions]: #optionsextensions
  535. [option-htmlextensions]: #optionshtmlextensions
  536. [marked]: https://github.com/markedjs/marked
  537. [markdown-it]: https://github.com/markdown-it/markdown-it
  538. [mdx]: https://github.com/mdx-js/mdx
  539. [prettier]: https://github.com/prettier/prettier
  540. [gatsby]: https://github.com/gatsbyjs/gatsby
  541. [commonmark]: #commonmark
  542. [size]: #size--debug
  543. [test]: #test
  544. [security]: #security
  545. [sponsor]: #sponsor
  546. [@wooorm]: https://github.com/wooorm
  547. [@johno]: https://github.com/johno
  548. [200]: https://github.com/micromark/micromark/releases/tag/2.0.0