An open API service indexing awesome lists of open source software.

https://github.com/bredele/vomit-markdown


https://github.com/bredele/vomit-markdown

Last synced: over 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# vomit-markdown

Generates live example from markdown file.

## Usage

This module is a duplex stream that returns a HTML string from markdown and generates live
example from `vomit` tagged snippets.

```js
var fs = require('fs')
var markdown = require('markdown')

fs.createReadStream(__dirname + '/readme.md')
.pipe(markdown)
.pipe(dest)
```

See and run example by typing:

```shell
# run test
$ npm test
```

## Standard

A vomit markdown can include live examples by including snippets of code as following:



```vomit
function component(data) {
return document.createElement('button')
}
```

Snippets of code have to contain at least a function called `component``. This function can take data as input
and should always return a DOM element.

## License

MIT License

Copyright (c) 2016 Olivier Wietrich

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE