question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I’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 taskdefault. Registerdefaultbefore 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:closed
  • Created 8 years ago
  • Comments:45 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
jonschlinkertcommented, Jul 6, 2016

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

0reactions
jonschlinkertcommented, Mar 27, 2016

Made it work… But to get this to work, these criteria has to be met:

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:

  • “Install verb#dev globally”
  • “Install verb-readme-generator locally (pref with --save-dev)” this should only need to be installed globally
  • “Have a .verb.md file” verb will ask you if you want to add one. I have this working locally
  • "Have a package.json-config which HAS TO contain these attributes with correct values: author:name, author:url, repository, and verb:tasks:[“readme”],verb:layout" Theverb` property should be optional. If this is causing problems that’s a bug. Author can be a string or object. Verb parses package.json.
  • “I think some of the attributes has to be set to use the default layout, but you have to set a layout it seems to produce the TOC.” If you use your own layout, you need to add <!-- toc -->, or if you use a verb layout you need to enable the toc either by setting toc: 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
Read more comments on GitHub >

github_iconTop Results From Across the Web

No toc generated with output: md_document #1216 - GitHub
Hello, I've tried the latest CRAN version and the dev version. While setting toc: true for a md_document, the table of contents is...
Read more >
Generating .toc file without generating a ToC - TeX
Problem: I want to generate a .toc file without the table of contents actually being displayed anywhere in the text.
Read more >
TOC is suddenly not being recognized, Word 2016, Win 10
It was a surprise because there IS at TOC, generated automatically, which has been functioning without a hitch in this document.
Read more >
Video: Take tables of contents (TOCs) to the next level
Delete the current TOC, click where you want to add the new TOC, open the Table of ... To change the number of...
Read more >
Manual:Table of contents - MediaWiki
By default, a table of contents (sometimes abbreviated to TOC) is automatically generated on a page when more than three section headings ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found