Comparing version 0.10.0 to 0.11.0
@@ -13,7 +13,7 @@ 'use strict'; | ||
function matchesStart(line) { | ||
return (/<!-- START doctoc generated TOC /).test(line); | ||
return (/<!-- START doctoc /).test(line); | ||
} | ||
function matchesEnd(line) { | ||
return (/<!-- END doctoc generated TOC /).test(line); | ||
return (/<!-- END doctoc /).test(line); | ||
} | ||
@@ -20,0 +20,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"description": "Generates TOC for markdown files of local git repo.", | ||
"version": "0.10.0", | ||
"version": "0.11.0", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -15,2 +15,3 @@ # DocToc [![build status](https://secure.travis-ci.org/thlorenz/doctoc.png)](http://travis-ci.org/thlorenz/doctoc) | ||
- [Adding toc to all files in a directory and sub directories](#adding-toc-to-all-files-in-a-directory-and-sub-directories) | ||
- [Update existing doctoc TOCs effortlessly](#update-existing-doctoc-tocs-effortlessly) | ||
- [Adding toc to a single file](#adding-toc-to-a-single-file) | ||
@@ -20,2 +21,3 @@ - [Example](#example) | ||
- [Example](#example-1) | ||
- [Specifying location of toc](#specifying-location-of-toc) | ||
@@ -39,4 +41,8 @@ <!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
subdirectories with a table of content that will point at the anchors generated | ||
by the github markdown parser. | ||
by the markdown parser. Doctoc defaults to using the GitHub parser, but other [modes can be specified](#using-doctoc-to-generate-links-compatible-with-other-sites). | ||
### Update existing doctoc TOCs effortlessly | ||
If you already have a TOC inserted by doctoc, it will automatically be updated by running the command (rather than inserting a duplicate toc). Doctoc locates the TOC by the `<!-- START doctoc -->` and `<!-- END doctoc -->` comments, so you can also move a generated TOC to any other portion of your document and it will be updated there. | ||
### Adding toc to a single file | ||
@@ -59,7 +65,7 @@ | ||
``` | ||
--bitbucket bitbucket.org | ||
--nodejs nodejs.org | ||
--github github.com | ||
--gitlab gitlab.com | ||
--ghost ghost.org | ||
--bitbucket bitbucket.org | ||
--nodejs nodejs.org | ||
--github github.com | ||
--gitlab gitlab.com | ||
--ghost ghost.org | ||
``` | ||
@@ -70,1 +76,28 @@ | ||
doctoc README.md --bitbucket | ||
### Specifying location of toc | ||
By default, doctoc places the toc at the top of the file. You can indicate to have it placed elsewhere with the following format: | ||
``` | ||
<!-- START doctoc --> | ||
<!-- END doctoc --> | ||
``` | ||
You place this code directly in your .md file. For example: | ||
``` | ||
// my_new_post.md | ||
Here we are, introducing the post. It's going to be great! | ||
But first: a TOC for easy reference. | ||
<!-- START doctoc --> | ||
<!-- END doctoc --> | ||
# Section One | ||
Here we'll discuss... | ||
``` | ||
Running doctoc will insert the toc to that location. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30524
99