Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add indent-spaces option #43

Merged
merged 1 commit into from
May 9, 2024
Merged

Conversation

joshuaprince
Copy link
Contributor

Add "--indent-spaces" integer option to specify the number of spaces to add in the TOC per indentation level. Defaults to the current width of 3 spaces.

Add test cases for the new "indentSpaces" parameter as well as the existing "indentCharacters" parameter.


This is a great tool! For my use case, I had to use 2 spaces per indent in the TOC. This seems like the best way to do it. I also added a bonus test case for the flag this one is modeled on. Validated passing tests, and the option shows and works in the browser.

@derlin
Copy link
Owner

derlin commented May 8, 2024

This is a great PR, thank you @joshuaprince !

Two minor fixes before I can merge:

  1. can you also update the README (the Usage: bitdowntoc ... code block) so it shows the new option?
  2. can you rephrase your commit so it uses a present imperative tone (with a verb)? For instance feat: add indent-spaces option or feat: make TOC indentation configurable?

Add "--indent-spaces" integer option to specify the number of spaces
to add in the TOC per indentation level. Defaults to the current width
of 3 spaces.

Add test cases for the new "indentSpaces" parameter as well as the
existing "indentCharacters" parameter.
@joshuaprince joshuaprince changed the title feat: configurable TOC indentation width feat: add indent-spaces option May 9, 2024
@joshuaprince
Copy link
Contributor Author

Done!

@derlin derlin merged commit 481b0a6 into derlin:main May 9, 2024
1 check passed
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.

2 participants