Skip to content

Commit

Permalink
Add examples to readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmpfs committed Mar 21, 2016
1 parent 84bf16d commit a599708
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,26 @@ ast.src('## Heading\n\nParagraph.')
.pipe(process.stdout);
```

## Examples

Remove all headings from a document:

```shell
mkcat README.md | mkfilter --heading | mkout
```

Remove everything but headings and text from a document:

```shell
mkcat README.md | mkfilter --heading --text --invert | mkout
```

Print code blocks in a document:

```shell
mkcat README.md | mkfilter --code-block --invert | mkout
```

## Help

```
Expand Down
2 changes: 1 addition & 1 deletion doc/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Create the stream and write a [commonmark][] document:

<? @source {javascript=s/\.\.\/index/mkfilter/gm} usage.js ?>

<? @include readme/help.md ?>
<? @include {=readme} examples.md help.md ?>

<? @exec mkapi index.js --title=API --level=2 ?>
<? @include {=readme} license.md links.md ?>
19 changes: 19 additions & 0 deletions doc/readme/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Examples

Remove all headings from a document:

```shell
mkcat README.md | mkfilter --heading | mkout
```

Remove everything but headings and text from a document:

```shell
mkcat README.md | mkfilter --heading --text --invert | mkout
```

Print code blocks in a document:

```shell
mkcat README.md | mkfilter --code-block --invert | mkout
```

0 comments on commit a599708

Please sign in to comment.