Skip to content

Correctly handle case where "See Also" section follows "Examples" in global_enable_try_examples #251

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion jupyterlite_sphinx/_try_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,16 @@ def _process_literal_blocks(md_text):
_next_section_pattern = re.compile(
"|".join(
[
rf".. (rubric|admonition)::\s*{header}"
rf"\.\. (rubric|admonition)::\s*{header}"
for header in _non_example_docstring_section_headers
]
# If examples section is last, processed by numpydoc may appear at end.
+ [r"\!\! processed by numpydoc \!\!"]
# Attributes section sometimes has no directive.
+ [r":Attributes:"]
# See Also sections are mapped to Sphinx's `.. seealso::` directive,
# not admonitions or rubrics.
+ [r"\.\. seealso::"]
)
)

Expand Down
Loading