Skip to content

Commit

Permalink
add sponsor to readme
Browse files Browse the repository at this point in the history
and some minor linting
  • Loading branch information
jonschlinkert committed Jul 13, 2023
1 parent f920342 commit d59bc46
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 75 deletions.
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

26 changes: 18 additions & 8 deletions .verb.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Quick Start
## Quick Start
Assuming you want to add a TOC to README.md:
1. `$ npm install -g markdown-toc`
2. Edit README.md and insert the following line where you want the TOC inserted:<br />`<!-- toc -->`
Expand Down Expand Up @@ -66,7 +66,7 @@ toc('# One\n\n# Two').content;
To allow customization of the output, an object is returned with the following properties:

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

## API
Expand Down Expand Up @@ -102,7 +102,7 @@ Results in:

### toc.json

Object for creating a custom TOC.
Object for creating a custom TOC.

```js
toc('# AAA\n## BBB\n### CCC\nfoo').json;
Expand All @@ -116,7 +116,7 @@ toc('# AAA\n## BBB\n### CCC\nfoo').json;

### toc.insert

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.
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.

_(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)._

Expand Down Expand Up @@ -160,8 +160,8 @@ var toc = require('markdown-toc');
```
- `toc.bullets()`: render a bullet list from an array of tokens
- `toc.linkify()`: linking a heading `content` string
- `toc.slugify()`: slugify a heading `content` string
- `toc.strip()`: strip words or characters from a heading `content` string
- `toc.slugify()`: slugify a heading `content` string
- `toc.strip()`: strip words or characters from a heading `content` string

**Example**

Expand Down Expand Up @@ -191,15 +191,15 @@ Type: `Function`

Default: `undefined`

Params:
Params:

- `str` **{String}** the actual heading string
- `ele` **{Objecct}** object of heading tokens
- `arr` **{Array}** all of the headings objects

**Example**

From time to time, we might get junk like this in our TOC.
From time to time, we might get junk like this in our TOC.

```
[.aaa([foo], ...) another bad heading](#-aaa--foo--------another-bad-heading)
Expand Down Expand Up @@ -263,3 +263,13 @@ Type: `Boolean`
Default: `true`

Strip extraneous HTML tags from heading text before slugifying. This is similar to GitHub markdown behavior.

## Sponsors

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)

### Gold Sponsors

| [<img src="https://github.com/jonschlinkert/clone-deep/assets/383994/98036489-2cae-48a2-8d29-7dec58ea05c4" alt="https://jaake.tech/" width="100"/>](https://jaake.tech/) |
|:---:|
| [https://jaake.tech/](https://jaake.tech/) |
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013-2017, Jon Schlinkert.
Copyright (c) 2013-2023, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE.
149 changes: 102 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# markdown-toc [![NPM version](https://img.shields.io/npm/v/markdown-toc.svg?style=flat)](https://www.npmjs.com/package/markdown-toc) [![NPM monthly downloads](https://img.shields.io/npm/dm/markdown-toc.svg?style=flat)](https://npmjs.org/package/markdown-toc) [![NPM total downloads](https://img.shields.io/npm/dt/markdown-toc.svg?style=flat)](https://npmjs.org/package/markdown-toc) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/markdown-toc.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/markdown-toc) [![Windows Build Status](https://img.shields.io/appveyor/ci/jonschlinkert/markdown-toc.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/jonschlinkert/markdown-toc)
# markdown-toc [![NPM version](https://img.shields.io/npm/v/markdown-toc.svg?style=flat)](https://www.npmjs.com/package/markdown-toc) [![NPM monthly downloads](https://img.shields.io/npm/dm/markdown-toc.svg?style=flat)](https://npmjs.org/package/markdown-toc) [![NPM total downloads](https://img.shields.io/npm/dt/markdown-toc.svg?style=flat)](https://npmjs.org/package/markdown-toc) [![Windows Build Status](https://img.shields.io/appveyor/ci/jonschlinkert/markdown-toc.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/jonschlinkert/markdown-toc)

> Generate a markdown TOC (table of contents) with Remarkable.
## Table of Contents
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.

- [Install](#install)
- [CLI](#cli)
- [Highlights](#highlights)
- [Usage](#usage)
- [API](#api)
Expand All @@ -21,6 +19,8 @@
* [options.maxdepth](#optionsmaxdepth)
* [options.firsth1](#optionsfirsth1)
* [options.stripHeadingTags](#optionsstripheadingtags)
- [Sponsors](#sponsors)
* [Gold Sponsors](#gold-sponsors)
- [About](#about)

_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_
Expand All @@ -33,6 +33,14 @@ Install with [npm](https://www.npmjs.com/):
$ npm install --save markdown-toc
```

## Quick Start

Assuming you want to add a TOC to README.md:

1. `$ npm install -g markdown-toc`
2. Edit README.md and insert the following line where you want the TOC inserted:<br />`<!-- toc -->`
3. `$ markdown-toc -i README.md`

## CLI

```
Expand All @@ -41,7 +49,26 @@ Usage: markdown-toc [options] <input>
input: The Markdown file to parse for table of contents,
or "-" to read from stdin.
-i: Edit the <input> file directly, injecting the TOC at <!-- toc -->;
-i: Edit the <input> file directly, injecting the TOC at - [Highlights](#highlights)
- [Usage](#usage)
- [API](#api)
* [toc.plugin](#tocplugin)
* [toc.json](#tocjson)
* [toc.insert](#tocinsert)
* [Utility functions](#utility-functions)
- [Options](#options)
* [options.append](#optionsappend)
* [options.filter](#optionsfilter)
* [options.slugify](#optionsslugify)
* [options.bullets](#optionsbullets)
* [options.maxdepth](#optionsmaxdepth)
* [options.firsth1](#optionsfirsth1)
* [options.stripHeadingTags](#optionsstripheadingtags)
- [Sponsors](#sponsors)
* [Gold Sponsors](#gold-sponsors)
- [About](#about)
_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_;
(Without this flag, the default is to print the TOC to stdout.)
--json: Print the TOC in JSON format
Expand All @@ -59,6 +86,9 @@ Usage: markdown-toc [options] <input>
--no-stripHeadingTags: Do not strip extraneous HTML tags from heading
text before slugifying
--indent: Provide the indentation to use - defaults to ' '
(to specify a tab, use the bash-escaped $'\t')
```

## Highlights
Expand Down Expand Up @@ -285,46 +315,38 @@ Default: `true`

Strip extraneous HTML tags from heading text before slugifying. This is similar to GitHub markdown behavior.

## About
## Sponsors

### Related projects
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)

* [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.")
* [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.")
* [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.")
* [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.")
* [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.")
### Gold Sponsors

### Contributing
| [<img src="https://github.com/jonschlinkert/clone-deep/assets/383994/98036489-2cae-48a2-8d29-7dec58ea05c4" alt="https://jaake.tech/" width="100"/>](https://jaake.tech/) |
|:---:|
| [https://jaake.tech/](https://jaake.tech/) |

## About

<details>
<summary><strong>Contributing</strong></summary>

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

### Contributors
</details>

| **Commits** | **Contributor** |
| --- | --- |
| 196 | [jonschlinkert](https://github.com/jonschlinkert) |
| 4 | [stefanwalther](https://github.com/stefanwalther) |
| 3 | [Marsup](https://github.com/Marsup) |
| 2 | [dvcrn](https://github.com/dvcrn) |
| 2 | [maxogden](https://github.com/maxogden) |
| 2 | [twang2218](https://github.com/twang2218) |
| 2 | [angrykoala](https://github.com/angrykoala) |
| 2 | [zeke](https://github.com/zeke) |
| 1 | [Vortex375](https://github.com/Vortex375) |
| 1 | [owzim](https://github.com/owzim) |
| 1 | [chendaniely](https://github.com/chendaniely) |
| 1 | [Daniel-Mietchen](https://github.com/Daniel-Mietchen) |
| 1 | [Feder1co5oave](https://github.com/Feder1co5oave) |
| 1 | [garygreen](https://github.com/garygreen) |
| 1 | [TehShrike](https://github.com/TehShrike) |
| 1 | [citizenmatt](https://github.com/citizenmatt) |
| 1 | [rafaelsteil](https://github.com/rafaelsteil) |
| 1 | [RichardBradley](https://github.com/RichardBradley) |
| 1 | [sethvincent](https://github.com/sethvincent) |
| 1 | [lu22do](https://github.com/lu22do) |

### Building docs
<details>
<summary><strong>Running Tests</strong></summary>

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:

```sh
$ npm install && npm test
```

</details>

<details>
<summary><strong>Building docs</strong></summary>

_(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.)_

Expand All @@ -334,26 +356,59 @@ To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```

### Running tests
</details>

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:
### Related projects

```sh
$ npm install && npm test
```
You might also be interested in these projects:

* [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.")
* [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.")
* [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.")
* [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.")
* [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.")

### Contributors

| **Commits** | **Contributor** |
| --- | --- |
| 198 | [jonschlinkert](https://github.com/jonschlinkert) |
| 9 | [doowb](https://github.com/doowb) |
| 4 | [dbooth-boston](https://github.com/dbooth-boston) |
| 3 | [sapegin](https://github.com/sapegin) |
| 3 | [Marsup](https://github.com/Marsup) |
| 2 | [dvcrn](https://github.com/dvcrn) |
| 2 | [maxogden](https://github.com/maxogden) |
| 2 | [twang2218](https://github.com/twang2218) |
| 2 | [zeke](https://github.com/zeke) |
| 1 | [Vortex375](https://github.com/Vortex375) |
| 1 | [chendaniely](https://github.com/chendaniely) |
| 1 | [Daniel-Mietchen](https://github.com/Daniel-Mietchen) |
| 1 | [Feder1co5oave](https://github.com/Feder1co5oave) |
| 1 | [garygreen](https://github.com/garygreen) |
| 1 | [TehShrike](https://github.com/TehShrike) |
| 1 | [citizenmatt](https://github.com/citizenmatt) |
| 1 | [mgroenhoff](https://github.com/mgroenhoff) |
| 1 | [rafaelsteil](https://github.com/rafaelsteil) |
| 1 | [RichardBradley](https://github.com/RichardBradley) |
| 1 | [sethvincent](https://github.com/sethvincent) |
| 1 | [shanehughes3](https://github.com/shanehughes3) |
| 1 | [bcho](https://github.com/bcho) |
| 1 | [lu22do](https://github.com/lu22do) |

### Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
* [GitHub Profile](https://github.com/jonschlinkert)
* [Twitter Profile](https://twitter.com/jonschlinkert)
* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)

### License

Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Copyright © 2023, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on September 19, 2017._
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on July 12, 2023._
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*!
* markdown-toc <https://github.com/jonschlinkert/markdown-toc>
*
* Copyright © 2013-2017, Jon Schlinkert.
* Copyright © 2013-2023, Jon Schlinkert.
* Released under the MIT License.
*/

Expand Down
31 changes: 28 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,31 +61,56 @@
"strip-color": "^0.1.0"
},
"devDependencies": {
"gulp-format-md": "^0.1.11",
"mocha": "^3.2.0"
"gulp-format-md": "^2.0.0",
"mocha": "^10.2.0"
},
"keywords": [
"anchor",
"API documentation",
"code documentation",
"commonmark",
"content navigation",
"content organization",
"developer tools",
"docs",
"document structure",
"document",
"documentation tool",
"documentation",
"glossary",
"heading",
"headings",
"index",
"javascript",
"links",
"markdown parser",
"markdown tools",
"Markdown-based",
"markdown-toc",
"markdown",
"markup language",
"md files",
"md parser",
"md-toc",
"md",
"node.js",
"npm",
"open-source",
"outline",
"package.json",
"plugin",
"README tool",
"readme",
"reference",
"remarkable",
"remarkableplugin",
"render",
"renderer",
"table",
"structure",
"table of contents",
"table-of-contents",
"table",
"toc-generator",
"toc",
"write"
],
Expand Down

0 comments on commit d59bc46

Please sign in to comment.