Skip to content

Commit

Permalink
Add example section.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmpfs committed Apr 18, 2016
1 parent 144a747 commit 6df80b7
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 39 deletions.
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ npm i -g mkdoc

- [Install](#install)
- [Usage](#usage)
- [Example](#example)
- [Guide](#guide)
- [Creating Tasks](#creating-tasks)
- [Task Documentation](#task-documentation)
Expand All @@ -29,7 +30,7 @@ npm i -g mkdoc
- [Stream Tasks](#stream-tasks)
- [Task Dependencies](#task-dependencies)
- [Task Arguments](#task-arguments)
- [Example](#example)
- [Sample](#sample)
- [Help](#help)
- [API](#api)
- [mk](#mk)
Expand Down Expand Up @@ -76,19 +77,27 @@ mk.task(readme);

Note that you **should not install** the `mktask` dependency, it is resolved by the command line program.

Then you can build all tasks using:
## Example

Build all tasks (or a main task when defined):

```shell
mk
```

Or specific tasks:
Build specific tasks:

```shell
mk readme
mk api readme
```

To see a list of the tasks use:
Use a specific build file:

```shell
mk -f ~/mkdoc.js readme
```

To see a list of tasks use:

```shell
mk --tasks
Expand Down Expand Up @@ -254,7 +263,7 @@ Note that some command line arguments are handled by the `mk` program you should
For detailed information on the `args` object see the [argparse library][argparse].
## Example
## Sample
Inline code examples from the working example in [/doc/example](https://github.com/mkdoc/mktask/blob/master/doc/example).
Expand Down Expand Up @@ -346,7 +355,7 @@ Options
-h, --help Display help and exit
--version Print the version and exit

mktask@1.3.8
mktask@1.3.9
```
## API
Expand Down
20 changes: 1 addition & 19 deletions doc/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,7 @@ Create a `mkdoc.js` task file like this one ([source file](/mkdoc.js)):

Note that you **should not install** the `mktask` dependency, it is resolved by the command line program.

Then you can build all tasks using:

```shell
mk
```

Or specific tasks:

```shell
mk readme
```

To see a list of the tasks use:

```shell
mk --tasks
```

<? @include {=readme} guide.md example.md help.md ?>
<? @include {=readme} example.md guide.md sample.md help.md ?>

<? @exec mkapi *.js --title=API --level=2 ?>
<? @include {=readme} license.md links.md ?>
29 changes: 16 additions & 13 deletions doc/readme/example.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
## Example

Inline code examples from the working example in [/doc/example](/doc/example).
Build all tasks (or a main task when defined):

The build file [mkdoc.js](/doc/example/mkdoc.js):
```shell
mk
```

<? @source {javascript} ../example/mkdoc.js ?>
Build specific tasks:

The input source file [source.md](/doc/example/source.md):
```shell
mk api readme
```

<? @source {markdown} ../example/source.md ?>
Use a specific build file:

Include file [include.md](/doc/example/include.md):
```shell
mk -f ~/mkdoc.js readme
```

<? @source {markdown} ../example/include.md ?>
To see a list of tasks use:

Include file [links.md](/doc/example/links.md):
```shell
mk --tasks
```

<? @source {markdown} ../example/links.md ?>

Result:

<? @exec {markdown} cd doc/example && mk ?>
23 changes: 23 additions & 0 deletions doc/readme/sample.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Sample

Inline code examples from the working example in [/doc/example](/doc/example).

The build file [mkdoc.js](/doc/example/mkdoc.js):

<? @source {javascript} ../example/mkdoc.js ?>

The input source file [source.md](/doc/example/source.md):

<? @source {markdown} ../example/source.md ?>

Include file [include.md](/doc/example/include.md):

<? @source {markdown} ../example/include.md ?>

Include file [links.md](/doc/example/links.md):

<? @source {markdown} ../example/links.md ?>

Result:

<? @exec {markdown} cd doc/example && mk ?>

0 comments on commit 6df80b7

Please sign in to comment.