Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
angdev committed Feb 26, 2013
1 parent 036b4fc commit 59d9ba0
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#md4template

## Installation

```bash
$ npm install md4template
```

## Feature

* Parsing a markdown file on file system.
Expand All @@ -16,23 +22,31 @@ md4tpl.config['encoding'] = 'utf8';

//default prefix - ''
//prefix for key of returned array from 'parseDir'.
md4tpl.config['prefix'] = 'md';
md4tpl.config['prefix'] = 'md_';

//parse a markdown file.
parsed_str = md4tpl.parseFile(file_path);

//parse markdown files in a directory.
parsed_list = md4tpl.parseDir(dir_path);

//if there are files 'index.md', 'work.md' in dir_path..
//'md_' is prefix.
//parsed_list = { "md_index" : [html code of index.md], "md_work" : [html code of md_work.md] }
```

## Example
### md4template with express, ejs.

> expressApp/public/markdown/index/
* current.md

* favorite.md

* work.md

***

* route/index.js

Expand Down

0 comments on commit 59d9ba0

Please sign in to comment.