From 6df80b730dd5bae861f2d4f2f5e6010fafbe9cfc Mon Sep 17 00:00:00 2001 From: muji Date: Mon, 18 Apr 2016 16:19:11 +0800 Subject: [PATCH] Add example section. --- README.md | 23 ++++++++++++++++------- doc/readme.md | 20 +------------------- doc/readme/example.md | 29 ++++++++++++++++------------- doc/readme/sample.md | 23 +++++++++++++++++++++++ 4 files changed, 56 insertions(+), 39 deletions(-) create mode 100644 doc/readme/sample.md diff --git a/README.md b/README.md index 60c3b23..83af7ee 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ npm i -g mkdoc - [Install](#install) - [Usage](#usage) +- [Example](#example) - [Guide](#guide) - [Creating Tasks](#creating-tasks) - [Task Documentation](#task-documentation) @@ -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) @@ -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 @@ -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). @@ -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 diff --git a/doc/readme.md b/doc/readme.md index a2b84f8..2e26cf2 100644 --- a/doc/readme.md +++ b/doc/readme.md @@ -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 -``` - - + diff --git a/doc/readme/example.md b/doc/readme/example.md index 5670ccd..112df7b 100644 --- a/doc/readme/example.md +++ b/doc/readme/example.md @@ -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 +``` - +Build specific tasks: -The input source file [source.md](/doc/example/source.md): +```shell +mk api readme +``` - +Use a specific build file: -Include file [include.md](/doc/example/include.md): +```shell +mk -f ~/mkdoc.js readme +``` - +To see a list of tasks use: -Include file [links.md](/doc/example/links.md): +```shell +mk --tasks +``` - - -Result: - - diff --git a/doc/readme/sample.md b/doc/readme/sample.md new file mode 100644 index 0000000..faa2d44 --- /dev/null +++ b/doc/readme/sample.md @@ -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): + + + +The input source file [source.md](/doc/example/source.md): + + + +Include file [include.md](/doc/example/include.md): + + + +Include file [links.md](/doc/example/links.md): + + + +Result: + +