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.
[Live demo](http://jonschlinkert.github.io/remarkable/demo/)
/INTRO/
__[Live demo](http://jonschlinkert.github.io/remarkable/demo/)__
Install
@ -35,11 +33,14 @@ Usage
```javascript
var Remarkable = require('remarkable');
var md = new Remarkable({
html: false,
xhtml: false,
breaks: true,
langprefix: 'language-',
highlight: function (str, lang) { return str; }
html: false, // enable html tags in source
xhtml: false, // use '/' to close single tags (<br />)
breaks: true, // convert '\n' in paragraphs into <br>
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!'));
@ -54,10 +55,7 @@ var md = new Remarkable();
md.set({
html: false,
xhtml: false,
breaks: true,
langprefix: 'language-',
highlight: function (str, lang) { return str; }
breaks: true
});
```

2
demo/index.jade

@ -23,7 +23,7 @@ html
- var s = self.self.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')
code.js= s.code

13
demo/sample.js

@ -1,10 +1,13 @@
var Remarkable = require('remarkable');
var md = new Remarkable({
html: true,
xhtml: true,
breaks: false,
langprefix: 'language-'
html: false, // enable html tags in source
xhtml: false, // use '/' to close single tags (<br />)
breaks: true, // convert '\n' in paragraphs into <br>
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!'));

Loading…
Cancel
Save