unexpected-markdown

A markdown parser that evaluates examples and highligh syntax using unexpected

MIT 32 个版本
安装
npm install unexpected-markdown
yarn add unexpected-markdown
pnpm add unexpected-markdown
bun add unexpected-markdown
README

This module uses the markdown parser marked to generate html output from markdown files.

NPM version Build Status Coverage Status

In addition to what marked already offers, this module uses magicpen-prism to syntax highlight code blocks and uses unexpected to evaluate JavaScript code examples.

Right now the documentation for this plugin is pretty lacking, until that is fixed the best example on how to use the plugin is to look at how it is used in unexpected.

An example is a JavaScript code block:

```js
helloWorld()
```

If you expect the example to fail, you can follow the code block with an expected output block:

```output
Error: Silence this is a library!
```

There are a few things you can achieve more then what is explained above, like async examples with promises and skiping examples for different environments or just skipping evaluation altogether. For now you'll have to look at how unexpected does it to learn the ticks.

版本列表
6.0.1 2020-11-22
6.0.0 2020-07-04
5.0.1 2020-03-22
5.0.0 2020-01-02
4.2.0 2019-12-31
4.1.1 2019-11-18
4.1.0 2019-11-12
4.0.0 2019-06-23
3.0.0 2019-01-18
2.1.0 2019-01-10
2.0.0 2019-01-01
1.7.4 2017-08-31
1.7.3 2017-08-30
1.7.2 2017-04-24
1.7.1 2016-06-12
1.7.0 2016-06-11
1.6.1 2016-04-11
1.6.0 2016-04-11
1.5.1 2016-04-10
1.5.0 2016-04-10
1.4.1 2016-04-01
1.4.0 2016-04-01
1.3.4 2016-03-20
1.3.2 2016-03-12
1.3.1 2016-01-03
1.3.0 2015-10-11
1.2.0 2015-09-25
1.1.2 2015-08-28
1.1.1 2015-08-09
1.1.0 2015-08-04
1.0.1 2015-08-04
1.0.0 2015-08-04