Skip to content

Commit ae81f0c

Browse files
committed
Use mkdoc for the readme.
1 parent c02cce7 commit ae81f0c

File tree

4 files changed

+86
-135
lines changed

4 files changed

+86
-135
lines changed

README.md

+48-91
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,40 @@
1-
Table of Contents
2-
=================
3-
4-
* [Async Validate](#async-validate)
5-
* [Install](#install)
6-
* [Usage](#usage)
7-
* [Guide](#guide)
8-
* [Descriptor](#descriptor)
9-
* [Object Definition](#object-definition)
10-
* [Array Definition](#array-definition)
11-
* [Function Definition](#function-definition)
12-
* [Composite Definition](#composite-definition)
13-
* [Rules](#rules)
14-
* [Inline Rule](#inline-rule)
15-
* [Assigned Rule](#assigned-rule)
16-
* [Plugin Rule](#plugin-rule)
17-
* [Multiple Rules](#multiple-rules)
18-
* [Deep Rules](#deep-rules)
19-
* [Properties](#properties)
20-
* [Type Identifier](#type-identifier)
21-
* [Enumerable](#enumerable)
22-
* [Date Format](#date-format)
23-
* [Message](#message)
24-
* [Required](#required)
25-
* [Additional](#additional)
26-
* [Fields](#fields)
27-
* [Pattern](#pattern)
28-
* [Placeholder](#placeholder)
29-
* [Range](#range)
30-
* [Length](#length)
31-
* [Values](#values)
32-
* [Match](#match)
33-
* [Resolve](#resolve)
34-
* [Test](#test)
35-
* [Whitespace](#whitespace)
36-
* [Errors](#errors)
37-
* [Plugins](#plugins)
38-
* [Loading Plugins](#loading-plugins)
39-
* [Creating Plugins](#creating-plugins)
40-
* [Helper Plugins](#helper-plugins)
41-
* [pattern](#pattern)
42-
* [range](#range)
43-
* [required](#required)
44-
* [type](#type)
45-
* [Validation](#validation)
46-
* [Bail](#bail)
47-
* [Variables](#variables)
48-
* [State](#state)
49-
* [Messages](#messages)
50-
* [Transform](#transform)
51-
* [API](#api)
52-
* [Schema](#schema)
53-
* [messages](#messages)
54-
* [validate](#validate)
55-
* [Schema.plugin](#schemaplugin)
56-
* [Schema.clone](#schemaclone)
57-
* [Rule](#rule)
58-
* [isRoot](#isroot)
59-
* [reason](#reason)
60-
* [raise](#raise)
61-
* [format](#format)
62-
* [validates](#validates)
63-
* [diff](#diff)
64-
* [Error](#error)
65-
* [Reason](#reason)
66-
* [Developer](#developer)
67-
* [Test](#test-1)
68-
* [Spec](#spec)
69-
* [Cover](#cover)
70-
* [Lint](#lint)
71-
* [Browser](#browser)
72-
* [Clean](#clean)
73-
* [Docs](#docs)
74-
* [Example](#example)
75-
* [Readme](#readme)
76-
* [License](#license)
77-
78-
Async Validate
79-
==============
80-
81-
[<img src="https://travis-ci.org/tmpfs/async-validate.svg" alt="Build Status">](https://travis-ci.org/tmpfs/async-validate)
82-
[<img src="http://img.shields.io/npm/v/async-validate.svg" alt="npm version">](https://npmjs.org/package/async-validate)
83-
[<img src="https://coveralls.io/repos/tmpfs/async-validate/badge.svg?branch=master&service=github&v=1" alt="Coverage Status">](https://coveralls.io/github/tmpfs/async-validate?branch=master).
1+
## Async Validate
2+
3+
[![Build Status](https://travis-ci.org/tmpfs/async-validate.svg)](https://travis-ci.org/tmpfs/async-validate)
4+
[![npm version](http://img.shields.io/npm/v/async-validate.svg)](https://npmjs.org/package/async-validate)
5+
[![Coverage Status](https://coveralls.io/repos/tmpfs/async-validate/badge.svg?branch=master&service=github&v=1)](https://coveralls.io/github/tmpfs/async-validate?branch=master)
6+
7+
---
8+
9+
- [Async Validate](#async-validate)
10+
- [Install](#install)
11+
- [Usage](#usage)
12+
- [Guide](#guide)
13+
- [Descriptor](#descriptor)
14+
- [Rules](#rules)
15+
- [Errors](#errors)
16+
- [Plugins](#plugins)
17+
- [Validation](#validation)
18+
- [Messages](#messages)
19+
- [Transform](#transform)
20+
- [API](#api)
21+
- [Developer](#developer)
22+
- [Test](#test)
23+
- [Spec](#spec)
24+
- [Cover](#cover)
25+
- [Lint](#lint)
26+
- [Browser](#browser)
27+
- [Clean](#clean)
28+
- [Docs](#docs)
29+
- [Example](#example)
30+
- [Readme](#readme)
31+
- [License](#license)
32+
33+
---
34+
35+
[![Build Status](https://travis-ci.org/tmpfs/async-validate.svg)](https://travis-ci.org/tmpfs/async-validate)
36+
[![npm version](http://img.shields.io/npm/v/async-validate.svg)](https://npmjs.org/package/async-validate)
37+
[![Coverage Status](https://coveralls.io/repos/tmpfs/async-validate/badge.svg?branch=master&service=github&v=1)](https://coveralls.io/github/tmpfs/async-validate?branch=master)
8438

8539
Asynchronous validation for [node](http://nodejs.org) and the browser.
8640

@@ -562,7 +516,7 @@ function id(cb) {
562516

563517
Plugins are modules defining functions that allow users to only load functionality specific to the rule types being used which allows builds for the browser to be as lean as possible.
564518

565-
See [zephyr](https://github.com/tmpfs/zephyr) for plugin system documentation.
519+
See [zephyr][] for plugin system documentation.
566520

567521
#### Loading Plugins
568522

@@ -941,7 +895,7 @@ You must supply a reason `id`; if `opts` are passed they are assigned as propert
941895

942896
## Developer
943897

944-
Clone the repository, install project and global dependencies ([mdp](https://github.com/tmpfs/mdp), [jshint](http://jshint.com) and [jscs](http://jscs.info)):
898+
Clone the repository, install project and global dependencies ([mdp][], [jshint][] and [jscs][]):
945899

946900
```
947901
npm i && npm i -g mdp jshint jscs
@@ -973,15 +927,15 @@ npm run cover
973927

974928
### Lint
975929

976-
Run the source tree through [jshint](http://jshint.com) and [jscs](http://jscs.info):
930+
Run the source tree through [jshint][] and [jscs][]:
977931

978932
```
979933
npm run lint
980934
```
981935

982936
### Browser
983937

984-
Create a standalone [browserify](http://browserify.org/) build:
938+
Create a standalone [browserify][] build:
985939

986940
```
987941
npm run browser
@@ -1005,15 +959,15 @@ npm run docs
1005959

1006960
### Example
1007961

1008-
Generate [EXAMPLE](https://github.com/tmpfs/async-validate/blob/master/EXAMPLE.md) (requires [mdp](https://github.com/tmpfs/mdp)):
962+
Generate [EXAMPLE](https://github.com/tmpfs/async-validate/blob/master/EXAMPLE.md) (requires [mdp][]):
1009963

1010964
```
1011-
npm run example
965+
npm run example
1012966
```
1013967

1014968
### Readme
1015969

1016-
Generate the readme file (requires [mdp](https://github.com/tmpfs/mdp)):
970+
Generate the readme file (requires [mdp][]):
1017971

1018972
```
1019973
npm run readme
@@ -1023,7 +977,9 @@ npm run readme
1023977

1024978
Everything is [MIT](http://en.wikipedia.org/wiki/MIT_License). Read the [license](https://github.com/tmpfs/async-validate/blob/master/LICENSE) if you feel inclined.
1025979

1026-
Generated by [mdp(1)](https://github.com/tmpfs/mdp).
980+
---
981+
982+
Created by [mkdoc](https://github.com/mkdoc/mkdoc) on February 27, 2017
1027983

1028984
[node]: http://nodejs.org
1029985
[npm]: http://www.npmjs.org
@@ -1032,3 +988,4 @@ Generated by [mdp(1)](https://github.com/tmpfs/mdp).
1032988
[jshint]: http://jshint.com
1033989
[jscs]: http://jscs.info
1034990
[zephyr]: https://github.com/tmpfs/zephyr
991+

doc/readme.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Async Validate
2+
3+
[![Build Status](https://travis-ci.org/tmpfs/async-validate.svg)](https://travis-ci.org/tmpfs/async-validate)
4+
[![npm version](http://img.shields.io/npm/v/async-validate.svg)](https://npmjs.org/package/async-validate)
5+
[![Coverage Status](https://coveralls.io/repos/tmpfs/async-validate/badge.svg?branch=master&service=github&v=1)](https://coveralls.io/github/tmpfs/async-validate?branch=master)
6+
7+
***
8+
<!-- @toc -->
9+
***
10+
11+
<? @include {=readme} introduction.md install.md usage.md ?>
12+
13+
<? @source {javascript} usage.js ?>
14+
15+
<? @include {=readme} guide.md messages.md transform.md ?>
16+
17+
<? @source {javascript} transform.js ?>
18+
19+
<? @include {=readme} api.md developer.md license.md links.md ?>

mkdoc.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
var mk = require('mktask');
2+
3+
// @task readme build the readme file.
4+
function readme(cb) {
5+
mk.doc('doc/readme.md')
6+
.pipe(mk.pi())
7+
.pipe(mk.ref())
8+
.pipe(mk.abs())
9+
.pipe(mk.msg())
10+
.pipe(mk.toc({depth: 2, max: 3}))
11+
.pipe(mk.out())
12+
.pipe(mk.dest('README.md'))
13+
.on('finish', cb);
14+
}
15+
16+
mk.task(readme);

package.json

+3-44
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"validation",
1414
"validate",
1515
"valid",
16-
"object"
16+
"object",
17+
"type"
1718
],
1819
"dependencies": {
1920
"format-util": "~1.0.3",
@@ -30,55 +31,13 @@
3031
"scripts": {
3132
"lint": "jshint . && jscs .",
3233
"docs": "npm run example && npm run readme",
33-
"readme": "mdp --force -v",
34+
"readme": "mk readme",
3435
"example": "mdp --force -v -i doc/example.json -o EXAMPLE.md",
3536
"browser": "browserify -o async-validate.js -e ./lib/schema.js && du -bh async-validate.js",
3637
"clean": "rm -rf coverage ./async-validate.js ./test/spec.js",
3738
"spec": "node test/build.js > test/index.js && browserify -o test/spec.js -e test/index.js",
3839
"test": "NODE_ENV=test mocha test/global ${SPEC:-test/spec}",
3940
"cover": "NODE_ENV=test istanbul cover _mocha -- test/global ${SPEC:-test/spec}",
4041
"coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"
41-
},
42-
"mdp": {
43-
"title": "Async Validate",
44-
"pedantic": true,
45-
"include": "doc/readme",
46-
"require": "lib",
47-
"links": "links.md",
48-
"toc": "Table of Contents",
49-
"base": "https://github.com/tmpfs/async-validate",
50-
"partial": [
51-
{
52-
"inc": [
53-
"introduction.md",
54-
"install.md",
55-
"usage.md"
56-
]
57-
},
58-
{
59-
"inc": "../usage.js",
60-
"type": "code",
61-
"language": "javascript"
62-
},
63-
{
64-
"inc": [
65-
"guide.md",
66-
"messages.md",
67-
"transform.md"
68-
]
69-
},
70-
{
71-
"inc": "../transform.js",
72-
"type": "code",
73-
"language": "javascript"
74-
},
75-
{
76-
"inc": [
77-
"api.md",
78-
"developer.md",
79-
"license.md"
80-
]
81-
}
82-
]
8342
}
8443
}

0 commit comments

Comments
 (0)