Skip to content

Commit

Permalink
Allow disabling automatic table of contents
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Aug 31, 2019
1 parent 3210a96 commit cee5001
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ if (argv.help) {

packageOpts.validateLinks = packageOpts.validateLinks !== false
packageOpts.paddedTable = packageOpts.paddedTable !== false
packageOpts.toc = packageOpts.toc !== false

deglob(glob, { usePackageJson: false, cwd, ignore }, function (err, files) {
if (err) throw err
Expand Down
11 changes: 7 additions & 4 deletions options.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,17 @@ module.exports = function (argv, packageOpts, files, cwd, repository) {
// Skip updating contributors table in lint mode
fix ? [require('remark-git-contributors'), { contributors }] : null,
[require('remark-github'), { repository }],
[require('remark-toc'), {

// TODO: https://github.com/vweevers/hallmark/issues/36
packageOpts.toc ? [require('remark-toc'), {
maxDepth: 2,
tight: true
}],
[require('remark-collapse'), {
}] : null,
packageOpts.toc ? [require('remark-collapse'), {
test: /^table of contents$/i,
summary: 'Click to expand'
}],
}] : null,

require('./lint')(fix, cwd, packageOpts, repository)
].filter(Boolean),
settings: {
Expand Down

0 comments on commit cee5001

Please sign in to comment.