From 6f09f26eb9f067f18f26aa7957e0b42e4029e048 Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Thu, 28 Jan 2016 09:30:07 -0500 Subject: [PATCH] updating documentation --- README.md | 68 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 55 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 8c53bd2..df79428 100644 --- a/README.md +++ b/README.md @@ -10,32 +10,74 @@ This NPM library is just a single function that implements the CML spec by conve - Install it using NPM: `npm install cml-html-converter` - require the module, then call it. ```javascript - 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 converter = require('cml-html-converter'); +var exampleString = "if the first line contains a line break after it, it is rendered as a header\n" + +"\n" + +"sub headings are single lines that have a line break before and after them, but are not the first line\n" + +"\n" + +"This single line contains a period. Therefore, it is rendered as a paragraph. It also contains a link to http://www.google.com, so that is rendered appropriately.\n"+ +"\n" + +"lines that either directly preceed another line of text\n" + +" or directly succeed another line of text\n" + +" are rendered as lists\n" + +" they can also contain links http://www.google.com\n" + +" you can only forward indent\n" + +" one tab\n" + +" at a\n" + +" time\n" + +" but you can back indent as much as you'd like\n" + +"\n" + +"sub heading 2\n"; +ub heading 2'; +var htmlString = converter(exampleCMLString); ``` - in the example above `htmlString` should look something like this: ```html +

if the first line contains a line break after it, it is rendered as a header

+

sub headings are single lines that have a line break before and after them, but are not the first line

+

This single line contains a period. Therefore, it is rendered as a paragraph. It also contains a link to http://www.google.com, so that is rendered appropriately.

+

sub heading 2

```