FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add :shows-source-link: option to Sphinx plot directive by lpsinger · Pull Request #24215 · matplotlib/matplotlib · GitHub

Repository navigation

Add :shows-source-link: option to Sphinx plot directive - #24215

Merged
timhoffm merged 1 commit into
matplotlib:mainfrom
lpsinger:show-source-link-option
Nov 11, 2022
Merged

timhoffm merged 1 commit into
matplotlib:mainfrom
lpsinger:show-source-link-option

Conversation

lpsinger commented Oct 18, 2022 •
edited
Loading

Copy link
Copy Markdown
Contributor

The Sphinx plot directive (.. plot::) now supports a :show-source-link option to show or hide the link to the source for each plot. The default is set using the plot_html_show_source_link variable in conf.py (which itself defaults to True).

PR Summary

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

lpsinger force-pushed the show-source-link-option branch 2 times, most recently from 9c5a5dc to 8fae504 Compare October 18, 2022 19:50
Comment thread lib/matplotlib/tests/test_sphinxext.py Outdated

MikhailRyazanov commented Oct 18, 2022 •
edited
Loading

Copy link
Copy Markdown
Contributor

Just a remark that source links are currently broken for singlehtml and dirhtml builders (as well as for building multiple targets, for example, html after latex), see issues #13858 and #24005 and the proposed solution in PR #24205. Not that this PR makes the problem worse, but it modifies the broken file-copying code and depends on its behavior in the tests.

Copy link
Copy Markdown
Contributor Author

Any update on this?

story645 added the Documentation: build building the docs label Nov 11, 2022
story645 added this to the v3.7.0 milestone Nov 11, 2022
lpsinger requested review from story645 and removed request for timhoffm November 11, 2022 15:31

timhoffm left a comment •
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I was held up by #24215 (comment). But now realized that we're not hooking deeper into that functionality for execution. We only rely on it in tests. - Therefore, the worst that can happen is that our tests become broken and we have to come up with a better test, but the functionality on the user side is not affect.

This is good to go, modulo my comment on the test.

Comment thread lib/matplotlib/tests/test_sphinxext.py Outdated
Comment thread lib/matplotlib/tests/test_sphinxext.py Outdated
lpsinger force-pushed the show-source-link-option branch 2 times, most recently from 0379f0d to a126736 Compare November 11, 2022 17:52
lpsinger requested review from timhoffm and removed request for story645 November 11, 2022 17:53
lpsinger force-pushed the show-source-link-option branch from a126736 to 3f011be Compare November 11, 2022 17:53

Copy link
Copy Markdown
Member

Precommit sees trailing whitespace

Copy link
Copy Markdown
Contributor Author

I pushed one more little change to fix this error from the CI pipeline:

trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing doc/users/next_whats_new/show_source_links_directive_option.rst

Copy link
Copy Markdown
Contributor Author

Precommit sees trailing whitespace

That's fixed now. Should be ready to go.

Copy link
Copy Markdown
Member

@lpsinger do you want to squash/rebase or should I?

The Sphinx plot directive (`.. plot::`) now supports a
`:show-source-link` option to show or hide the link to the source
for each plot. The default is set using the
`plot_html_show_source_link` variable in `conf.py` (which itself
defaults to True).

Copy link
Copy Markdown
Contributor Author

@lpsinger do you want to squash/rebase or should I?

Done.

lpsinger force-pushed the show-source-link-option branch from 2fea052 to d58fc21 Compare November 11, 2022 20:19
timhoffm merged commit 19d9340 into matplotlib:main Nov 11, 2022

Copy link
Copy Markdown
Member

Thanks @lpsinger

Copy link
Copy Markdown
Contributor Author

Thank you!

lpsinger deleted the show-source-link-option branch November 11, 2022 22:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation: build building the docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL