Skip to content

Commit 81c44bd

Browse files
committed
Restored README.md from 3c6eb6a
1 parent d3d5aa9 commit 81c44bd

File tree

1 file changed

+44
-75
lines changed

1 file changed

+44
-75
lines changed

README.md

Lines changed: 44 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
55
## Table of Contents
66

7+
- [Install](#install)
8+
- [CLI](#cli)
79
- [Highlights](#highlights)
810
- [Usage](#usage)
911
- [API](#api)
@@ -24,24 +26,13 @@
2426
_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_
2527

2628
## Install
29+
2730
Install with [npm](https://www.npmjs.com/):
2831

2932
```sh
3033
$ npm install --save markdown-toc
3134
```
3235

33-
Install with [yarn](https://yarnpkg.com):
34-
35-
```sh
36-
$ yarn add markdown-toc
37-
```
38-
39-
## Quick Start
40-
Assuming you want to add a TOC to README.md:
41-
1. `$ npm install -g markdown-toc`
42-
2. Edit README.md and insert the following line where you want the TOC inserted:<br />`<!-- toc -->`
43-
3. `$ markdown-toc -i README.md`
44-
4536
## CLI
4637

4738
```
@@ -50,24 +41,7 @@ Usage: markdown-toc [options] <input>
5041
input: The Markdown file to parse for table of contents,
5142
or "-" to read from stdin.
5243
53-
-i: Edit the <input> file directly, injecting the TOC at - [Highlights](#highlights)
54-
- [Usage](#usage)
55-
- [API](#api)
56-
* [toc.plugin](#tocplugin)
57-
* [toc.json](#tocjson)
58-
* [toc.insert](#tocinsert)
59-
* [Utility functions](#utility-functions)
60-
- [Options](#options)
61-
* [options.append](#optionsappend)
62-
* [options.filter](#optionsfilter)
63-
* [options.slugify](#optionsslugify)
64-
* [options.bullets](#optionsbullets)
65-
* [options.maxdepth](#optionsmaxdepth)
66-
* [options.firsth1](#optionsfirsth1)
67-
* [options.stripHeadingTags](#optionsstripheadingtags)
68-
- [About](#about)
69-
70-
_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_;
44+
-i: Edit the <input> file directly, injecting the TOC at <!-- toc -->;
7145
(Without this flag, the default is to print the TOC to stdout.)
7246
7347
--json: Print the TOC in JSON format
@@ -91,18 +65,18 @@ _(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](
9165

9266
**Features**
9367

94-
- Can optionally be used as a [remarkable][] plugin
95-
- Returns an object with the rendered TOC (on `content`), as well as a `json` property with the raw TOC object, so you can generate your own TOC using templates or however you want
96-
- Works with [repeated headings](https://gist.github.com/jonschlinkert/ac5d8122bfaaa394f896)
97-
- Uses sane defaults, so no customization is necessary, but you can if you need to.
98-
- [filter](#filter-headings) out headings you don't want
99-
- [Improve](#titleize) the headings you do want
100-
- Use a custom [slugify](#optionsslugify) function to change how links are created
68+
* Can optionally be used as a [remarkable](https://github.com/jonschlinkert/remarkable) plugin
69+
* Returns an object with the rendered TOC (on `content`), as well as a `json` property with the raw TOC object, so you can generate your own TOC using templates or however you want
70+
* Works with [repeated headings](https://gist.github.com/jonschlinkert/ac5d8122bfaaa394f896)
71+
* Uses sane defaults, so no customization is necessary, but you can if you need to.
72+
* [filter](#filter-headings) out headings you don't want
73+
* [Improve](#titleize) the headings you do want
74+
* Use a custom [slugify](#optionsslugify) function to change how links are created
10175

10276
**Safe!**
10377

104-
- Won't mangle markdown in code examples in gfm code blocks that other TOC generators mistake as being actual headings (this happens when markdown headings are show in _examples_, meaning they arent' actually headings that should be in the toc. Also happens with yaml and coffee-script comments, or any comments that use `#`)
105-
- Won't mangle front-matter, or mistake front-matter properties for headings like other TOC generators
78+
* Won't mangle markdown in code examples in gfm code blocks that other TOC generators mistake as being actual headings (this happens when markdown headings are show in _examples_, meaning they arent' actually headings that should be in the toc. Also happens with yaml and coffee-script comments, or any comments that use `#`)
79+
* Won't mangle front-matter, or mistake front-matter properties for headings like other TOC generators
10680

10781
## Usage
10882

@@ -117,15 +91,15 @@ toc('# One\n\n# Two').content;
11791

11892
To allow customization of the output, an object is returned with the following properties:
11993

120-
- `content` **{String}**: The generated table of contents. Unless you want to customize rendering, this is all you need.
121-
- `highest` **{Number}**: The highest level heading found. This is used to adjust indentation.
122-
- `tokens` **{Array}**: Headings tokens that can be used for custom rendering
94+
* `content` **{String}**: The generated table of contents. Unless you want to customize rendering, this is all you need.
95+
* `highest` **{Number}**: The highest level heading found. This is used to adjust indentation.
96+
* `tokens` **{Array}**: Headings tokens that can be used for custom rendering
12397

12498
## API
12599

126100
### toc.plugin
127101

128-
Use as a [remarkable][] plugin.
102+
Use as a [remarkable](https://github.com/jonschlinkert/remarkable) plugin.
129103

130104
```js
131105
var Remarkable = require('remarkable');
@@ -154,7 +128,7 @@ Results in:
154128

155129
### toc.json
156130

157-
Object for creating a custom TOC.
131+
Object for creating a custom TOC.
158132

159133
```js
160134
toc('# AAA\n## BBB\n### CCC\nfoo').json;
@@ -167,7 +141,7 @@ toc('# AAA\n## BBB\n### CCC\nfoo').json;
167141

168142
### toc.insert
169143

170-
Insert a table of contents immediately after an _opening_ `<!-- toc -->` code comment, or replace an existing TOC if both an _opening_ comment and a _closing_ comment (`<!-- tocstop -->`) are found.
144+
Insert a table of contents immediately after an _opening_ `<!-- toc -->` code comment, or replace an existing TOC if both an _opening_ comment and a _closing_ comment (`<!-- tocstop -->`) are found.
171145

172146
_(This strategy works well since code comments in markdown are hidden when viewed as HTML, like when viewing a README on GitHub README for example)._
173147

@@ -209,10 +183,11 @@ As a convenience to folks who wants to create a custom TOC, markdown-toc's inter
209183
```js
210184
var toc = require('markdown-toc');
211185
```
212-
- `toc.bullets()`: render a bullet list from an array of tokens
213-
- `toc.linkify()`: linking a heading `content` string
214-
- `toc.slugify()`: slugify a heading `content` string
215-
- `toc.strip()`: strip words or characters from a heading `content` string
186+
187+
* `toc.bullets()`: render a bullet list from an array of tokens
188+
* `toc.linkify()`: linking a heading `content` string
189+
* `toc.slugify()`: slugify a heading `content` string
190+
* `toc.strip()`: strip words or characters from a heading `content` string
216191

217192
**Example**
218193

@@ -241,15 +216,15 @@ Type: `Function`
241216

242217
Default: `undefined`
243218

244-
Params:
219+
Params:
245220

246-
- `str` **{String}** the actual heading string
247-
- `ele` **{Objecct}** object of heading tokens
248-
- `arr` **{Array}** all of the headings objects
221+
* `str` **{String}** the actual heading string
222+
* `ele` **{Objecct}** object of heading tokens
223+
* `arr` **{Array}** all of the headings objects
249224

250225
**Example**
251226

252-
From time to time, we might get junk like this in our TOC.
227+
From time to time, we might get junk like this in our TOC.
253228

254229
```
255230
[.aaa([foo], ...) another bad heading](#-aaa--foo--------another-bad-heading)
@@ -311,23 +286,25 @@ Default: `true`
311286
Strip extraneous HTML tags from heading text before slugifying. This is similar to GitHub markdown behavior.
312287

313288
## About
289+
314290
### Related projects
315-
- [gfm-code-blocks](https://www.npmjs.com/package/gfm-code-blocks): Extract gfm (GitHub Flavored Markdown) fenced code blocks from a string. | [homepage](https://github.com/jonschlinkert/gfm-code-blocks "Extract gfm (GitHub Flavored Markdown) fenced code blocks from a string.")
316-
- [markdown-link](https://www.npmjs.com/package/markdown-link): Micro util for generating a single markdown link. | [homepage](https://github.com/jonschlinkert/markdown-link "Micro util for generating a single markdown link.")
317-
- [markdown-utils](https://www.npmjs.com/package/markdown-utils): Micro-utils for creating markdown snippets. | [homepage](https://github.com/jonschlinkert/markdown-utils "Micro-utils for creating markdown snippets.")
318-
- [pretty-remarkable](https://www.npmjs.com/package/pretty-remarkable): Plugin for prettifying markdown with Remarkable using custom renderer rules. | [homepage](https://github.com/jonschlinkert/pretty-remarkable "Plugin for prettifying markdown with Remarkable using custom renderer rules.")
319-
- [remarkable](https://www.npmjs.com/package/remarkable): Markdown parser, done right. 100% Commonmark support, extensions, syntax plugins, high speed - all in… [more](https://github.com/jonschlinkert/remarkable) | [homepage](https://github.com/jonschlinkert/remarkable "Markdown parser, done right. 100% Commonmark support, extensions, syntax plugins, high speed - all in one.")
291+
292+
* [gfm-code-blocks](https://www.npmjs.com/package/gfm-code-blocks): Extract gfm (GitHub Flavored Markdown) fenced code blocks from a string. | [homepage](https://github.com/jonschlinkert/gfm-code-blocks "Extract gfm (GitHub Flavored Markdown) fenced code blocks from a string.")
293+
* [markdown-link](https://www.npmjs.com/package/markdown-link): Micro util for generating a single markdown link. | [homepage](https://github.com/jonschlinkert/markdown-link "Micro util for generating a single markdown link.")
294+
* [markdown-utils](https://www.npmjs.com/package/markdown-utils): Micro-utils for creating markdown snippets. | [homepage](https://github.com/jonschlinkert/markdown-utils "Micro-utils for creating markdown snippets.")
295+
* [pretty-remarkable](https://www.npmjs.com/package/pretty-remarkable): Plugin for prettifying markdown with Remarkable using custom renderer rules. | [homepage](https://github.com/jonschlinkert/pretty-remarkable "Plugin for prettifying markdown with Remarkable using custom renderer rules.")
296+
* [remarkable](https://www.npmjs.com/package/remarkable): Markdown parser, done right. 100% Commonmark support, extensions, syntax plugins, high speed - all in… [more](https://github.com/jonschlinkert/remarkable) | [homepage](https://github.com/jonschlinkert/remarkable "Markdown parser, done right. 100% Commonmark support, extensions, syntax plugins, high speed - all in one.")
320297

321298
### Contributing
299+
322300
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
323301

324302
### Contributors
303+
325304
| **Commits** | **Contributor** |
326305
| --- | --- |
327306
| 196 | [jonschlinkert](https://github.com/jonschlinkert) |
328-
| 5 | [doowb](https://github.com/doowb) |
329307
| 4 | [stefanwalther](https://github.com/stefanwalther) |
330-
| 3 | [sapegin](https://github.com/sapegin) |
331308
| 3 | [Marsup](https://github.com/Marsup) |
332309
| 2 | [dvcrn](https://github.com/dvcrn) |
333310
| 2 | [maxogden](https://github.com/maxogden) |
@@ -347,9 +324,8 @@ Pull requests and stars are always welcome. For bugs and feature requests, [plea
347324
| 1 | [sethvincent](https://github.com/sethvincent) |
348325
| 1 | [lu22do](https://github.com/lu22do) |
349326

350-
### Release history
351-
352327
### Building docs
328+
353329
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
354330

355331
To generate the readme, run the following command:
@@ -367,24 +343,17 @@ $ npm install && npm test
367343
```
368344

369345
### Author
346+
370347
**Jon Schlinkert**
371348

372-
+ [github/jonschlinkert](https://github.com/jonschlinkert)
373-
+ [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
349+
* [github/jonschlinkert](https://github.com/jonschlinkert)
350+
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
374351

375352
### License
353+
376354
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
377355
Released under the [MIT License](LICENSE).
378356

379357
***
380358

381-
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on October 25, 2017._
382-
383-
[gfm-code-blocks]: https://github.com/jonschlinkert/gfm-code-blocks
384-
[markdown-link]: https://github.com/jonschlinkert/markdown-link
385-
[markdown-utils]: https://github.com/jonschlinkert/markdown-utils
386-
[pretty-remarkable]: https://github.com/jonschlinkert/pretty-remarkable
387-
[remarkable]: https://github.com/jonschlinkert/remarkable
388-
[verb-readme-generator]: https://github.com/verbose/verb-readme-generator
389-
[verb]: https://github.com/verbose/verb
390-
359+
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on September 19, 2017._

0 commit comments

Comments
 (0)