Skip to content

Add a --bullet MARKER option to mdtoc - #8

Open
Gulliby wants to merge 1 commit into
mainfrom
feature/mdtoc-bullet-marker
Open

Gulliby wants to merge 1 commit into
mainfrom
feature/mdtoc-bullet-marker

Conversation

@Gulliby

@Gulliby Gulliby commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Requested by gulliby

Before: mdtoc always wrote its bullets with -.

After: --bullet MARKER (or --bullet=MARKER) chooses -, * or + as the bullet marker. It works when generating, with --check, --print and --insert. Use the same marker to generate and to check, because a block with another marker counts as stale. Any other value is an error, and so is the combination with --numbered; both exit 1 with a one-line message. The combination is checked together with the other combinations, so --help still wins over it. The README has a new section and a table row. 194 tests pass (183 before); tsc and biome are clean.

How: src/cli.ts reads and checks the option while it reads the arguments, and src/toc.ts takes the marker. One new test file, tests/bullet.test.ts, holds the cases. Three existing tests change because they pin the first help line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant