Skip to content
This repository was archived by the owner on Dec 11, 2024. It is now read-only.

Commit 3e81353

Browse files
committed
Add example section to readme.
1 parent 5c78f98 commit 3e81353

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ For the command line interface install [mkdoc][] globally (`npm i -g mkdoc`).
2222

2323
- [Install](#install)
2424
- [Usage](#usage)
25+
- [Example](#example)
2526
- [Help](#help)
2627
- [API](#api)
2728
- [abs](#abs)
@@ -43,6 +44,20 @@ ast.src('[readme](/README.md)')
4344
.pipe(process.stdout);
4445
```
4546

47+
## Example
48+
49+
Make links absolute using data in `package.json`:
50+
51+
```shell
52+
mkcat README.md | mkabs | mkout
53+
```
54+
55+
Make links absolute using an specific URL:
56+
57+
```shell
58+
mkcat README.md | mkabs -b http://example.com | mkout
59+
```
60+
4661
## Help
4762

4863
```

doc/readme.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@ The typical use case is for README documents whose forward slash links work as e
1414
<!-- @toc -->
1515
***
1616

17-
## Usage
18-
19-
Create the stream and write a [commonmark][] document:
20-
21-
<? @source {javascript=s/\.\.\/index/mkabs/gm} usage.js ?>
22-
23-
<? @include {=readme} help.md ?>
17+
<? @include {=readme} usage.md example.md help.md ?>
2418

2519
<? @exec mkapi index.js absolute.js --title=API --level=2 ?>
2620
<? @include {=readme} license.md links.md ?>

doc/readme/usage.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Usage
2+
3+
Create the stream and write a [commonmark][] document:
4+
5+
<? @source {javascript=s/\.\.\/index/mkabs/gm} ../usage.js ?>
6+

0 commit comments

Comments
 (0)