Add option to enable toc by default #76
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Perhaps it's only me, but I wanted a way to globally enable tables of contents and merely override it on a page-by-page basis. This PR adds an option for that,
enable_by_default
.This PR also makes
toc_only
return nothing when toc is disabled. This might bea more controversial change (which perhaps should be in a different PR), but I can't really think of a case where the previous behavior would be desired. I also realize this probably breaks some tests. Unfortunately, when I went to look, a whole bunch of tests seemed to be failing even on master. I recognize that it's a bit poor form to submit a PR without updating the tests, but I'm not too sure what's going on there (plus I'm not familiar with ruby at all).