https://github.com/benignware/livemd
Generate live-samples from markdown files
https://github.com/benignware/livemd
browser documentation markdown
Last synced: about 1 month ago
JSON representation
Generate live-samples from markdown files
- Host: GitHub
- URL: https://github.com/benignware/livemd
- Owner: benignware
- License: mit
- Created: 2015-07-05T18:01:46.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-10-13T11:39:54.000Z (over 10 years ago)
- Last Synced: 2025-06-19T06:20:21.076Z (about 1 year ago)
- Topics: browser, documentation, markdown
- Language: JavaScript
- Size: 191 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# livemd
> Generate live-samples from markdown files
With livemd you can easily generate runtime browser samples from corresponding code-blocks contained in markdown-files.
Supported languages:
* HTML
* CSS
* Javascript
* Coffeescript
* SCSS
* Less
* Haml
## Install
```shell
npm install livemd --save-dev
```
To use with preprocessor languages you need the appropriate modules to be installed.
```shell
npm install coffee-script
npm install node-sass
npm install less
npm install hamljs
```
## Usage
```js
var livemd = require('livemd');
livemd(src).done(function(result) {
// Do something with the result
})
```
## Options
#### options.paths
Type: `Array`
Default value: `[]`
Provide an array of include paths to pass to scss and less modules. Path to source is included by default.
#### options.prefilter
Type: `Function`
Default value: `null`
Filter the input markdown by providing a function taking the original string as argument and returning the modified string.
#### options.wrap
Type: `String`
Default value: `'
'`
Specify a wrapper for the generated live-samples.
## Demo Projects
See these demo sites created with [grunt-livemd](https://github.com/benignware/grunt-livemd)
* [visualist](http://benignware.github.io/visualist/)
* [jquery-findus](http://benignware.github.io/jquery-findus/)
* [jquery-placepicker](http://benignware.github.io/jquery-placepicker/)
* [jquery-vgrd](http://benignware.github.io/jquery-vgrd/)
* [jquery-checkview](http://benignware.github.io/jquery-checkview/)
* [jquery-countimator](http://benignware.github.io/jquery-countimator/)
## Changelog
* v0.0.6 - Remove debug output ;-)
* v0.0.5 - Fixed fail on combined lexers
* v0.0.3 - Wrap CSS
* v0.0.2 - Added npm install info to README.md
* v0.0.1 - Initial Release