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

Simplify conf.py and RST to prep for Furo vs Pytorch config #268

Merged
merged 6 commits into from
Apr 14, 2023

Conversation

Eric-Arellano
Copy link
Collaborator

@Eric-Arellano Eric-Arellano commented Apr 12, 2023

We plan to land the Furo proof of concept soon (#233), so that people can more easily finish Qiskit-ifying the theme.

We have to set slightly different conf.py values, like html_theme_options. We'll do that by something like this:

if "FURO" in os.environ:
   # furo options
else:
   # pytorch options

So, this is prework to make conf.py as simple as possible before adding new complexity.

--

This also removes the unnecessary .. contents:: directives from some pages. They didn't actually do anything, but cause a huge warning when using Furo. With Pytorch, we still have our right page-level table of contents even without it.

@Eric-Arellano Eric-Arellano requested a review from javabster April 12, 2023 18:26
Copy link
Collaborator Author

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Reviewers: except for the code I commented on, everything was only moved around or had its comments deleted.


import qiskit_sphinx_theme
sys.path.insert(0, os.path.abspath('..'))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Using .. rather than . because this makes #265 simpler.


release = qiskit_sphinx_theme.__version__
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We now hardcode the release version. I don't think it makes a big difference having the actual version vs. 9.99 in these example docs.

I can add this back if you disagree though

app.setup_extension('docs.language_utils')
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Corresponds to the sys.path change from above.

@Eric-Arellano Eric-Arellano changed the title Simplify conf.py to prep for Furo vs Pytorch config Simplify conf.py and RST to prep for Furo vs Pytorch config Apr 12, 2023
# A boolean that decides whether module names are prepended to all object names
# (for object types where a “module” of some kind is defined), e.g. for
# py:function directives.
add_module_names = False
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I deleted this. It didn't do anything in the example docs. I think it was copy pasta from another repo.

# (e.g., if this is set to ['foo.'], then foo.bar is shown under B, not F).
# This can be handy if you document a project that consists of a single
# package. Works only for the HTML builder currently.
modindex_common_prefix = ['qiskit.']
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I deleted this. It didn't do anything in the example docs. I think it was copy pasta from another repo.

html_context = {
# toggle analytics
# Add "Was this page useful?" to the footer.
Copy link
Collaborator

Choose a reason for hiding this comment

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

so this is technically true specifically for this example docs conf.py but in production (i.e. for pages live at qiskit.org domains) this also tracks data relating to page views. I'm not sure if we really need to specify the difference in functionality in the comment here or not 🤔 I guess we've probably explained it enough in the README, but I get nervous sometimes about ensuring we're being as transparent as possible about data/analytics tracking. I'd say it would be a nice-to-have to explicitly mention the analytics/data tracking element of this here, but it's not blocking the PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can fix this in a follow up PR :)

Copy link
Collaborator

@javabster javabster left a comment

Choose a reason for hiding this comment

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

LGTM 🚀 Thanks for rewriting all the comments, I think this is much more accessible now for a new contributor 👍

@Eric-Arellano Eric-Arellano merged commit c9b9a41 into Qiskit:main Apr 14, 2023
@Eric-Arellano Eric-Arellano deleted the simplify-conf-py branch April 14, 2023 23:23
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.

2 participants