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

🐛 FIX: Fix edge-case when page is '#' #132

Merged
merged 2 commits into from
Jun 13, 2021

Conversation

pablogsal
Copy link
Contributor

When building on Read the Docs, the parameter
DOCUMENTATION_OPTIONS.URL_ROOT can return '#' and that returns an
incorrect path to the svg icon for the copy button.

Closes: #121

@welcome
Copy link

welcome bot commented Jun 12, 2021

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out EBP's Code of Conduct and our Contributing Guide, as this will greatly help the review process.

Welcome to the EBP community! 🎉

@pablogsal
Copy link
Contributor Author

CC: @pradyunsg @choldgraf

If this is good with you, it would be great if we can get a release out of it :)

@choldgraf
Copy link
Member

hmmm this doesn't seem quite right - the clipboards are missing in the readthedocs build. Can you confirm this works on your machine?

@pablogsal
Copy link
Contributor Author

pablogsal commented Jun 12, 2021

hmmm this doesn't seem quite right - the clipboards are missing in the readthedocs build. Can you confirm this works on your machine?

Ah, I just saw that the CI does a RTD build. Let me find out what's going on

When building on Read the Docs, the parameter
DOCUMENTATION_OPTIONS.URL_ROOT can return '#' and that returns an
incorrect path to the svg icon for the copy button.

Closes: executablebooks#121
@pablogsal
Copy link
Contributor Author

@choldgraf I think this should be fixed by now

@choldgraf
Copy link
Member

choldgraf commented Jun 12, 2021

cool - and this is probably obvious but just to confirm since we don't explicitly test for it here: this patch fixes your problem with the root doc not working properly?

(can we think of a way to test that case? I don't think it's strictly necessary but would be good if it's easy)

@pablogsal
Copy link
Contributor Author

cool - and this is probably obvious but just to confirm since we don't explicitly test for it here: this patch fixes your problem with the root doc not working properly?

Yup, I tested it here:

python/devguide#713

this is how it renders:

https://cpython-devguide--713.org.readthedocs.build/#

(can we think of a way to test that case? I don't think it's strictly necessary but would be good if it's easy)

I don't know what's the best way to test this. I have been checking the output of the RTD in the this repo CI when you click the root (as it adds the #).

pradyunsg
pradyunsg previously approved these changes Jun 12, 2021
Copy link
Member

@pradyunsg pradyunsg left a comment

Choose a reason for hiding this comment

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

LGTM, although a non-blocking concern that we're doing one unnecessary round trip, that's similar to:

s = "string"
y = f"{s}"

sphinx_copybutton/_static/copybutton.js_t Outdated Show resolved Hide resolved
@pradyunsg
Copy link
Member

pradyunsg commented Jun 12, 2021

An easy way to test this in this PR and make future breakage less likely, would be to add a code block to the documentation root for this too!

@choldgraf
Copy link
Member

@pradyunsg but there already is, isn't there? the landing page has code blocks in it. Am I missing something?

Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
@pradyunsg
Copy link
Member

Nope, I'm just a confused kiddo. :)

@choldgraf choldgraf changed the title Cover the case when DOCUMENTATION_OPTIONS.URL_ROOT returns '#' 🐛 FIX: Fix edge-case when page is '#' Jun 13, 2021
@choldgraf choldgraf merged commit 5e5ac74 into executablebooks:master Jun 13, 2021
@welcome
Copy link

welcome bot commented Jun 13, 2021

Congrats on your first merged pull request in this project! 🎉
congrats

Thank you for contributing, we are very proud of you! ❤️

@pablogsal
Copy link
Contributor Author

Thanks a lot @choldgraf for the review and the quick release ❤️

@pablogsal pablogsal deleted the fix branch June 15, 2021 22: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.

Link to static asset is broken for code blocks in the root_doc
3 participants