Skip to content

Some quality-of-life enhancements to toc.py CLI script #329

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

edoardob90
Copy link
Member

Hopefully closes #240.

Add proper error handling, logging, command-line options, and improved documentation. Clean anchor generation, add version, and enhance CLI help text.

Add proper error handling, logging, command-line options, and improved
documentation. Clean anchor generation, add version, and enhance
CLI help text with better descriptions and examples.
@edoardob90 edoardob90 added documentation Improvements or additions to documentation enhancement New feature or request labels May 13, 2025
Replace f-strings with %-style formatting in logger calls for better
performance. Use logger.exception() for better error reporting with
tracebacks.
@despadam
Copy link
Contributor

There is also: #131. Should that one be closed?

@edoardob90 edoardob90 mentioned this pull request May 13, 2025
2 tasks
@edoardob90
Copy link
Member Author

There is also: #131. Should that one be closed?

Done, closed. We can track all the relevant changes here.

Upgrade TocEntry from namedtuple to NamedTuple with type hints.
Improve logic for detecting and ignoring markdown headers inside
code blocks to prevent incorrect TOC entries. Also refactor the
file output handling for better organization when using --force.
@edoardob90 edoardob90 marked this pull request as ready for review May 13, 2025 19:52
@edoardob90 edoardob90 requested a review from yakutovicha May 13, 2025 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document the behaviour of the toc.py tool
2 participants