|
|
|
@ -8,14 +8,14 @@ This NPM library is just a single function that implements the CML spec by conve
|
|
|
|
|
|
|
|
|
|
|
|
## How do I use it?
|
|
|
|
## How do I use it?
|
|
|
|
- Install it using NPM: `npm install cml-html-converter`
|
|
|
|
- Install it using NPM: `npm install cml-html-converter`
|
|
|
|
- require it the module, then call it.
|
|
|
|
- require the module, then call it.
|
|
|
|
```javascript
|
|
|
|
```javascript
|
|
|
|
var exampleCMLString =
|
|
|
|
|
|
|
|
'item one of root list\n' +
|
|
|
|
|
|
|
|
'\titem one of 1st nested list\n' +
|
|
|
|
|
|
|
|
'\t\titem one of 2nd nested list\n' +
|
|
|
|
|
|
|
|
'\titem two of 1st nested list'
|
|
|
|
|
|
|
|
var converter = require('cml-html-converter');
|
|
|
|
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);
|
|
|
|
var htmlString = converter(exampleCMLString);
|
|
|
|
```
|
|
|
|
```
|
|
|
|
- in the example above `htmlString` should look something like this:
|
|
|
|
- in the example above `htmlString` should look something like this:
|
|
|
|
|