No TOC generated
See original GitHub issueI’ve installed both verb
and verb-cli
, executed it like this:
verb
Ok, it went through my .verb.md
file and polished it.
And, as the documentation clearly states:
Generate a Table of Contents simply by adding
<!-- toc -->
to any document.
And naively I believed the phrasing you have:
… with zero configuration required
So I will try to explain what I am doing, and what I expect:
Added <!-- toc -->
to the .verb.md
file, no TOC generated
Executed verb --toc
, no TOC generated
Executed verb
with "verb" : { "toc": true}
in package.json
, no TOC generated
Executed verb
with "verb --toc" : { "toc": true}
in package.json
, no TOC generated
Added a verbfile.js
with this:
'use strict';
var verb = require('verb');
var gutil = require('gulp-util');
verb.task('docs', function() {
verb.extendWith(require('verb-toc'));
verb.src(['.verb*.md'])
.on('error', gutil.log)
.pipe(verb.dest('./'));
});
verb.task('default', ['docs']);
Resulting in: [TypeError: verb.extendWith is not a function]
Added a verbfile.js
with this:
'use strict';
var gutil = require('gulp-util');
module.exports = function (verb) {
verb.extendWith(require('verb-toc'));
verb.task('default', function() {
verb.src(['.verb*.md'])
.on('error', gutil.log)
.pipe(verb.dest('./'));
});
return verb;
};
Resulting in: [Error: Invalid task
default. Register
defaultbefore calling run.]
So what is the diddly-o here?
Versions: alexander@alexander-w541-laptop ~/Workspace/proj f-verb ● npm -v && node -v && verb -v 3.3.12 v5.1.0
[11:01:46] CLI version 0.7.4
[11:01:46] Local version 0.8.10
[11:01:46] using verbfile ~/Workspace/proj/verbfile.js
Issue Analytics
- State:
- Created 8 years ago
- Comments:45 (13 by maintainers)
Top GitHub Comments
closing since TOC logic has been updated a few times since this issue, and verb uses the verb-toc plugin for this. If you still have issues with toc please open an issue on verb-toc or verb-readme-generator if that’s what you’re using
remember we’re still on
dev
brach. sorry for the issues but this feedback helps us a lot.some of these things sound like they work as expected, some do not:
verb#dev
globally”--save-dev
)” this should only need to be installed globally" The
verb` property should be optional. If this is causing problems that’s a bug. Author can be a string or object. Verb parses package.json.<!-- toc -->
, or if you use a verb layout you need to enable the toc either by settingtoc: true
in verb config in package.json, or by passing--toc
on the command line. but the latter will only add it that time. It doesn’t persist