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

Add options for include directive #684

Merged
merged 23 commits into from May 16, 2024

Conversation

frankharkins
Copy link
Contributor

@frankharkins frankharkins commented Apr 20, 2024

Adds support for the start-* and end-* options of the rst include directive. Closes #682.

pdoc/docstrings.py Outdated Show resolved Hide resolved
frankharkins and others added 5 commits April 27, 2024 15:50
Trimming the end of the contents means it often won't end in a newline
and will become part of the new paragraph. This change adds a newline to
contents after trimming the ends.

Also fix :end-line: option to be absolute (not relative to :start-line:)
Co-authored-by: Maximilian Hils <[email protected]>
@frankharkins frankharkins marked this pull request as ready for review April 27, 2024 16:48
frankharkins and others added 4 commits April 29, 2024 21:53
I somehow missed the last line of mhils comment earlier

Co-authored-by: Maximilian Hils <[email protected]>
@mhils
Copy link
Member

mhils commented May 2, 2024

Thanks! This looks super nice now. Could you please add some basic tests for _rst_extract_options and _rst_include_trim in test_docstrings.py? Otherwise this looks good to go.

@frankharkins
Copy link
Contributor Author

@mhils done, let me know if it's ok

Copy link
Member

@mhils mhils left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks! Just some minor nits.

test/test_docstrings.py Outdated Show resolved Hide resolved
test/test_docstrings.py Outdated Show resolved Hide resolved
@mhils mhils enabled auto-merge (squash) May 16, 2024 13:43
@mhils mhils merged commit fde455d into mitmproxy:main May 16, 2024
12 checks passed
@frankharkins
Copy link
Contributor Author

@mhils thanks for finishing this up! Sorry I didn't get round to it earlier

@frankharkins frankharkins deleted the FH/include-options branch May 16, 2024 19:04
@mhils
Copy link
Member

mhils commented May 16, 2024 via email

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.

Support start-after option for .. include:: directive
2 participants