doctoc
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -12,3 +12,5 @@ 'use strict'; | ||
, end = '<!-- END doctoc generated TOC please keep comment here to allow auto update -->' | ||
, skipTag = '<!-- DOCTOC SKIP -->'; | ||
function matchesStart(line) { | ||
@@ -111,2 +113,4 @@ return (/<!-- START doctoc /).test(line); | ||
exports = module.exports = function transform(content, mode, maxHeaderLevel, title, notitle, entryPrefix, processAll, updateOnly) { | ||
if (content.indexOf(skipTag) !== -1) return { transformed: false }; | ||
mode = mode || 'github.com'; | ||
@@ -113,0 +117,0 @@ entryPrefix = entryPrefix || '-'; |
@@ -5,3 +5,3 @@ { | ||
"description": "Generates TOC for markdown files of local git repo.", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
# DocToc [![build status](https://secure.travis-ci.org/thlorenz/doctoc.svg)](http://travis-ci.org/thlorenz/doctoc) | ||
<a href="https://www.patreon.com/bePatron?u=8663953"><img alt="become a patron" src="https://c5.patreon.com/external/logo/become_a_patron_button.png" height="35px"></a> | ||
Generates table of contents for markdown files inside local git repository. Links are compatible with anchors generated | ||
@@ -52,2 +50,4 @@ by github or other sites via a command line flag. | ||
### Ignoring individual files | ||
In order to ignore a specific file when running `doctoc` on an entire directory, just add `<!-- DOCTOC SKIP -->` to the top of the file you wish to ignore. | ||
@@ -70,10 +70,2 @@ ### Update existing doctoc TOCs effortlessly | ||
You can use this feature to do more sophisticated things. For example, if you | ||
have [ack][ack] installed, you could add `<!-- DOCTOC SKIP -->` to specific | ||
files and then use | ||
ack -L 'DOCTOC SKIP' | xargs doctoc | ||
to recompile only those files which don't have the DOCTOC SKIP comment. | ||
### Using doctoc to generate links compatible with other sites | ||
@@ -80,0 +72,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
359
20499
154
1