You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
119
+
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.
120
120
121
121
_(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)._
122
122
@@ -160,8 +160,8 @@ var toc = require('markdown-toc');
160
160
```
161
161
-`toc.bullets()`: render a bullet list from an array of tokens
162
162
-`toc.linkify()`: linking a heading `content` string
163
-
-`toc.slugify()`: slugify a heading `content` string
164
-
-`toc.strip()`: strip words or characters from a heading `content` string
163
+
-`toc.slugify()`: slugify a heading `content` string
164
+
-`toc.strip()`: strip words or characters from a heading `content` string
165
165
166
166
**Example**
167
167
@@ -191,15 +191,15 @@ Type: `Function`
191
191
192
192
Default: `undefined`
193
193
194
-
Params:
194
+
Params:
195
195
196
196
-`str`**{String}** the actual heading string
197
197
-`ele`**{Objecct}** object of heading tokens
198
198
-`arr`**{Array}** all of the headings objects
199
199
200
200
**Example**
201
201
202
-
From time to time, we might get junk like this in our TOC.
202
+
From time to time, we might get junk like this in our TOC.
203
203
204
204
```
205
205
[.aaa([foo], ...) another bad heading](#-aaa--foo--------another-bad-heading)
@@ -263,3 +263,13 @@ Type: `Boolean`
263
263
Default: `true`
264
264
265
265
Strip extraneous HTML tags from heading text before slugifying. This is similar to GitHub markdown behavior.
266
+
267
+
## Sponsors
268
+
269
+
The following companies, organizations, and individuals support the ongoing maintenance and development of {%= name %}. [Become a Sponsor](https://github.com/sponsors/jonschlinkert) to add your logo to this README, or any of [my other projects](https://github.com/jonschlinkert?tab=repositories&q=&type=&language=&sort=stargazers)
# markdown-toc [](https://www.npmjs.com/package/markdown-toc)[](https://npmjs.org/package/markdown-toc)[](https://npmjs.org/package/markdown-toc)[](https://ci.appveyor.com/project/jonschlinkert/markdown-toc)
2
2
3
3
> Generate a markdown TOC (table of contents) with Remarkable.
4
4
5
-
## Table of Contents
5
+
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
--no-stripHeadingTags: Do not strip extraneous HTML tags from heading
61
88
text before slugifying
89
+
90
+
--indent: Provide the indentation to use - defaults to ' '
91
+
(to specify a tab, use the bash-escaped $'\t')
62
92
```
63
93
64
94
## Highlights
@@ -285,46 +315,38 @@ Default: `true`
285
315
286
316
Strip extraneous HTML tags from heading text before slugifying. This is similar to GitHub markdown behavior.
287
317
288
-
## About
318
+
## Sponsors
289
319
290
-
### Related projects
320
+
The following companies, organizations, and individuals support the ongoing maintenance and development of markdown-toc. [Become a Sponsor](https://github.com/sponsors/jonschlinkert) to add your logo to this README, or any of [my other projects](https://github.com/jonschlinkert?tab=repositories&q=&type=&language=&sort=stargazers)
291
321
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.")
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
341
+
342
+
```sh
343
+
$ npm install && npm test
344
+
```
345
+
346
+
</details>
347
+
348
+
<details>
349
+
<summary><strong>Building docs</strong></summary>
328
350
329
351
_(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.)_
330
352
@@ -334,26 +356,59 @@ To generate the readme, run the following command:
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
361
+
### Related projects
340
362
341
-
```sh
342
-
$ npm install && npm test
343
-
```
363
+
You might also be interested in these projects:
364
+
365
+
*[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.")
366
+
*[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.")
367
+
*[markdown-utils](https://www.npmjs.com/package/markdown-utils): Tiny helpers for creating consistenly-formatted markdown snippets. | [homepage](https://github.com/jonschlinkert/markdown-utils"Tiny helpers for creating consistenly-formatted markdown snippets.")
368
+
*[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.")
369
+
*[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.")
0 commit comments