From d59bc4691f2cfa46bd2846302de7ee5472789889 Mon Sep 17 00:00:00 2001 From: Jon Schlinkert Date: Wed, 12 Jul 2023 20:37:49 -0400 Subject: [PATCH] add sponsor to readme and some minor linting --- .travis.yml | 14 ----- .verb.md | 26 ++++++--- LICENSE | 4 +- README.md | 149 +++++++++++++++++++++++++++++++++++---------------- index.js | 2 +- package.json | 31 +++++++++-- 6 files changed, 151 insertions(+), 75 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 67decb2..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -sudo: false -os: - - linux - - osx -language: node_js -node_js: - - node - - '8' - - '7' - - '6' - - '5' - - '4' - - '0.12' - - '0.10' diff --git a/.verb.md b/.verb.md index bdd7611..24fa17d 100644 --- a/.verb.md +++ b/.verb.md @@ -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:
`` @@ -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 @@ -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; @@ -116,7 +116,7 @@ toc('# AAA\n## BBB\n### CCC\nfoo').json; ### toc.insert -Insert a table of contents immediately after an _opening_ `` code comment, or replace an existing TOC if both an _opening_ comment and a _closing_ comment (``) are found. +Insert a table of contents immediately after an _opening_ `` code comment, or replace an existing TOC if both an _opening_ comment and a _closing_ comment (``) 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)._ @@ -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** @@ -191,7 +191,7 @@ Type: `Function` Default: `undefined` -Params: +Params: - `str` **{String}** the actual heading string - `ele` **{Objecct}** object of heading tokens @@ -199,7 +199,7 @@ Params: **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) @@ -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 + +| [https://jaake.tech/](https://jaake.tech/) | +|:---:| +| [https://jaake.tech/](https://jaake.tech/) | diff --git a/LICENSE b/LICENSE index 37be316..24d65b5 100644 --- a/LICENSE +++ b/LICENSE @@ -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 @@ -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. \ No newline at end of file +THE SOFTWARE. diff --git a/README.md b/README.md index b8766c4..fe3e0ee 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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))_ @@ -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:
`` +3. `$ markdown-toc -i README.md` + ## CLI ``` @@ -41,7 +49,26 @@ Usage: markdown-toc [options] input: The Markdown file to parse for table of contents, or "-" to read from stdin. - -i: Edit the file directly, injecting the TOC at ; + -i: Edit the 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 @@ -59,6 +86,9 @@ Usage: markdown-toc [options] --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 @@ -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 +| [https://jaake.tech/](https://jaake.tech/) | +|:---:| +| [https://jaake.tech/](https://jaake.tech/) | + +## About + +
+Contributing Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). -### Contributors +
-| **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 +
+Running Tests + +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 +``` + +
+ +
+Building docs _(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.)_ @@ -334,26 +356,59 @@ To generate the readme, run the following command: $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` -### Running tests +
-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._ \ No newline at end of file +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on July 12, 2023._ \ No newline at end of file diff --git a/index.js b/index.js index 90cb8be..64a5eb1 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ /*! * markdown-toc * - * Copyright © 2013-2017, Jon Schlinkert. + * Copyright © 2013-2023, Jon Schlinkert. * Released under the MIT License. */ diff --git a/package.json b/package.json index 2c870b4..25d988d 100644 --- a/package.json +++ b/package.json @@ -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" ],