Open spenpal opened 3 days ago
Absolutely, you can give it a try as long as there is no more dependencies added. You can update directly the current line parsing code.
As this is a breaking change, we need a new major version. Also, if the old fashion syntax is detected, building the documentation should fail with a migration note, indicating syntax evolved since x.x version.
I propose an enhancement to adopt a Python-like slicing syntax for line selection. This would bring more flexibility, clarity, and ease of maintenance for developers, alongside new options: the ability to exclude specific lines/ranges and negative indexing.
This feature would extend the current line selection system (
start-end, line
). The new syntax would offer a versatile way to define inclusion and exclusion rules for lines in a file, improving usability and maintaining alignment with the needs of developers working with Typedoc.Proposed Syntax
Indexing
start:end
).start:
or:end
) for selecting all lines from a starting point or up to an ending point, respectively.-1
for the last line,-2
for the second-to-last line, etc.).2:5, 10
).Exclusions
!
to exclude specific lines or ranges (!start:end
,!line
).Usage
Advantages
2:
) simplify maintenance, as files can grow without requiring updates to the tag.Roadmap
[2:3, 10]
)[!3, !5:7]
)[-3:, -5:-2]
)Feedback
I would love to hear your thoughts on this proposed feature. Is this approach something you see aligning with the goals of this plugin? Are there additional edge cases or scenarios you'd like addressed?