You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
10 years ago | |
|---|---|---|
| README.md | 10 years ago | |
| index.js | 10 years ago | |
| package.json | 10 years ago | |
README.md
CML To HTML Converter
What is CML?
Check out the spec!
What does this library do?
This NPM library is just a single function that implements the CML spec by converting a string of CML into HTML.
How do I use it?
- Install it using NPM:
npm install cml-html-converter - require the module, then call it.
var converter = require('cml-html-converter');
var exampleCMLString =
'item one of root list\n' + //no indentation
'\titem one of 1st nested list\n' + //indented once
'\t\titem one of 2nd nested list\n' + //indented twice
'\titem two of 1st nested list' //indented once
var htmlString = converter(exampleCMLString);
- in the example above
htmlStringshould look something like this:
<ul>
<li>
item one of root list
<ul>
<li>
item two of 1st nested list
<ul>
<li>
item one of 2nd nested list
</li>
</ul>
</li>
<li>
item two of 1st nested list
</li>
</ul>
</li>
</ul>