Skip to content

unexpectedjs/unexpected-markdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

408f634 · Apr 22, 2022
Oct 23, 2021
Apr 22, 2022
Apr 22, 2022
Jan 1, 2019
Jul 21, 2019
Apr 25, 2021
Jan 2, 2020
Aug 4, 2015
Dec 31, 2018
Nov 22, 2020
Jan 1, 2019
Aug 4, 2015
Jan 2, 2020
May 2, 2020
Apr 22, 2022

Repository files navigation

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.