Repository navigation
feat(toc): add --bullet option for TOC entries - #182
Merged
Merged
Conversation
--bullet <CHAR> starts every bullet entry of the TOC with *, - or + instead of *. It applies to every input and to --numbered outline. An unknown character and --bullet with --numbered list exit with code 1 before any network call. Fixes #71
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes #71: a way to start TOC entries with a dash instead of an asterisk.
--bullet <CHAR>takes*,-or+(the three bullet markers of CommonMark) andstarts every bullet entry with it:
- [Title](#title). The default stays*, so theoutput without the option is the same as before.
gh-md-toc:gh_toc_grab: the bullet is passed to the awk script withawk -vand replaces*in the entry marker. The script is shared by the default and OS/390 branches,so it applies to stdin, local files, remote URLs, several inputs,
--insertand--numbered outline(- [2.1. Section](#section)).gh_toc_app:--bulletis parsed right after--numberedand before-, in theexisting fixed order of options, so
--bullet - -reads stdin with dash bullets.gh_tocgets it as a new last (10th) parameter, read as${10}.--bulletwith--numbered list(an ordered list has no bullet).--help: a new line right after--numbered.README.md: an example in "Local files" after the--numbered outlineexample,without a new heading, so the README TOC asserted in the tests does not change.
tests/tests.bats: tests for a local file with-, stdin with--bullet - -,+with
--numbered outline, and both errors, on the existing fixtures;test_helpupdated.
openspec: theadd-toc-bulletchange (proposal, design, specs, tasks) is archived,with a new
toc-bulletspec and "Hierarchical numbers" intoc-numberedupdated forthe bullet.
Not included: other bullet characters, a different bullet per level, a change of the
default, the
--bullet=CHARsyntax.Testing
with it.
--bullet -, two local files with--bullet +,and
--insert --no-backupwith--bullet -on a copy ofREADME.md.make lintpasses.