Skip to content

Commit 12da33d

Browse files
author
Sethen
committed
Added bin for a proper CLI, markdown-include can now be required
1 parent 718988e commit 12da33d

File tree

5 files changed

+320
-296
lines changed

5 files changed

+320
-296
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* [Make a table of contents](#make-a-table-of-contents)
66
* [How To Install](#how-to-install)
77
* [How To Use](#how-to-use)
8+
* [From The Command Line](#from-the-command-line)
9+
* [As A Module](#as-a-module)
810
* [markdown.json](#markdownjson)
911
* [How It Works](#how-it-works)
1012

@@ -61,10 +63,22 @@ Use the `-g` flag if you wish to install markdown-include globally on your syste
6163

6264
# How To Use
6365

64-
markdown-include is very easy to use. Just include a `markdown.json` file in your project root with your options and run from the command line to compile your documents like so:
66+
markdown-include is very easy to use whether on the command line or in your own node project. Each can help you compile your markdown files as you see fit. markdown-include does require that you define a `markdown.json` file with your options for compile. See below for all of the options available to you.
67+
68+
## From The Command Line
69+
70+
Run from the command line to compile your documents like so:
71+
72+
```
73+
node_modules/bin/cli.js path/to/markdown.json
74+
```
75+
76+
## As A Module
77+
78+
Just require in your node project:
6579

6680
```
67-
node path/to/markdown-include.js path/to/markdown.json
81+
var markdownInclude = require('markdown-include');
6882
```
6983

7084
## markdown.json

bin/cli.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env node
2+
3+
require('../markdown-include').compileFiles(process.argv[2]);

docs/how_to_use.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
# How To Use !heading
22

3-
markdown-include is very easy to use. Just include a `markdown.json` file in your project root with your options and run from the command line to compile your documents like so:
3+
markdown-include is very easy to use whether on the command line or in your own node project. Each can help you compile your markdown files as you see fit. markdown-include does require that you define a `markdown.json` file with your options for compile. See below for all of the options available to you.
4+
5+
## From The Command Line !heading
6+
7+
Run from the command line to compile your documents like so:
8+
9+
```
10+
node_modules/bin/cli.js path/to/markdown.json
11+
```
12+
13+
## As A Module !heading
14+
15+
Just require in your node project:
416

517
```
6-
node path/to/markdown-include.js path/to/markdown.json
18+
var markdownInclude = require('markdown-include');
719
```
820

921
## markdown.json !heading

0 commit comments

Comments
 (0)