Browse Source

Docs update

pull/14/head
Vitaly Puzrin 10 years ago
parent
commit
65063c80c7
  1. 22
      README.md
  2. 2
      demo/index.jade
  3. 13
      demo/sample.js

22
README.md

@ -8,9 +8,7 @@ remarkable
Markdown parser done right. Fast and easy to extend. Markdown parser done right. Fast and easy to extend.
[Live demo](http://jonschlinkert.github.io/remarkable/demo/) __[Live demo](http://jonschlinkert.github.io/remarkable/demo/)__
/INTRO/
Install Install
@ -35,11 +33,14 @@ Usage
```javascript ```javascript
var Remarkable = require('remarkable'); var Remarkable = require('remarkable');
var md = new Remarkable({ var md = new Remarkable({
html: false, html: false, // enable html tags in source
xhtml: false, xhtml: false, // use '/' to close single tags (<br />)
breaks: true, breaks: true, // convert '\n' in paragraphs into <br>
langprefix: 'language-', langprefix: 'language-', // css language prefix for fenced blocks
highlight: function (str, lang) { return str; }
// Should return HTML markup for highlighted text,
// or empty string to escape source
highlight: function (str, lang) { return ''; }
}); });
console.log(md.parse('# Remarkable rulezz!')); console.log(md.parse('# Remarkable rulezz!'));
@ -54,10 +55,7 @@ var md = new Remarkable();
md.set({ md.set({
html: false, html: false,
xhtml: false, breaks: true
breaks: true,
langprefix: 'language-',
highlight: function (str, lang) { return str; }
}); });
``` ```

2
demo/index.jade

@ -23,7 +23,7 @@ html
- var s = self.self.demo; - var s = self.self.demo;
h1 Remarkable demo h1 Remarkable demo
p: a(data-toggle='collapse' href='#code-sample') Show code sample p: a(data-toggle='collapse' href='#code-sample') code sample
pre.collapse.code-sample(id='code-sample') pre.collapse.code-sample(id='code-sample')
code.js= s.code code.js= s.code

13
demo/sample.js

@ -1,10 +1,13 @@
var Remarkable = require('remarkable'); var Remarkable = require('remarkable');
var md = new Remarkable({ var md = new Remarkable({
html: true, html: false, // enable html tags in source
xhtml: true, xhtml: false, // use '/' to close single tags (<br />)
breaks: false, breaks: true, // convert '\n' in paragraphs into <br>
langprefix: 'language-' langprefix: 'language-', // css language prefix for fenced blocks
// Should return HTML markup for highlighted text,
// or empty string to escape source
highlight: function (str, lang) { return ''; }
}); });
console.log(md.parse('# Remarkable rulezz!')); console.log(md.parse('# Remarkable rulezz!'));

Loading…
Cancel
Save