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

Use the "sphinx-copybutton" extension in documentation #1651

Merged
merged 2 commits into from
Jun 14, 2022

Conversation

rahulporuri
Copy link
Contributor

@rahulporuri rahulporuri commented Jun 11, 2022

This PR does the following -

  • Use the sphinx_copybutton extension when building the sphinx documentation.
  • Make sphinx-copybutton a docs extra for the traits package
  • Installs sphinx-copybutton when building documentation on GitHub Actions CI
  • Installs sphinx-copybutton from PyPI when building a development environment using the etstool utility.

Ref https://sphinx-copybutton.readthedocs.io/en/latest/

Checklist

  • Tests
  • Update API reference (docs/source/traits_api_reference)
  • Update User manual (docs/source/traits_user_manual)
  • Update type annotation hints in traits-stubs

	modified:   .github/workflows/test-documentation-build.yml
	modified:   docs/source/conf.py
	modified:   etstool.py
	modified:   setup.py
@mdickinson
Copy link
Member

@rahulporuri Thanks for the PR.

Sphinx maintenance hasn't been completely painless in the past, and I'm a little bit nervous about adding another third-party dependency - it would be much better if there were something in one of the built-in Sphinx extensions.

That said, this should be an easy-to-maintain addition, and it's definitely valuable. Let's merge and see how this goes; if maintaining it turns out to be problematic, we may need to reconsider.

If we switch to a different theme at some point in the future, it may be that the new theme supports this out of the box.

@mdickinson
Copy link
Member

Let's merge and see how this goes

Actually, before I do that I'm going to merge the corresponding PR on Traits Futures, since T-F has an automated doc build that'll let us see results quickly.

@mdickinson
Copy link
Member

Results look good on T-F, both on docs.enthought.com and Read the Docs. Merging here.

@mdickinson mdickinson enabled auto-merge (squash) June 14, 2022 11:14
Copy link
Member

@mdickinson mdickinson left a comment

Choose a reason for hiding this comment

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

LGTM

@mdickinson mdickinson merged commit f17231e into main Jun 14, 2022
@mdickinson mdickinson deleted the docs/sphinx-copybutton branch June 14, 2022 11:15
mdickinson pushed a commit that referenced this pull request Aug 9, 2022
DOC: Use the sphinx-copybutton extension in documentation

	modified:   .github/workflows/test-documentation-build.yml
	modified:   docs/source/conf.py
	modified:   etstool.py
	modified:   setup.py

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
(cherry picked from commit f17231e)
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.

None yet

2 participants