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

support string-based attributes #9

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

Conversation

epinzur
Copy link

@epinzur epinzur commented Nov 3, 2023

Added support for string-based attributes. Also added 2 new range attributes: start-after and end-before.

This addition is based on the Sphinx literal-include directive: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-literalinclude

It allows you to specify the code-block range using code comments instead of line numbers. This allows for editing of the included code file without having to re-figure-out the numeric ranges you want to include.

You can now specify the start and end of code blocks via string labels. 

This greatly improves the experience because you can edit the source file and rely on the string labels to grab the correct code blocks.

No more adjusting line numbers after making edits
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