-
Notifications
You must be signed in to change notification settings - Fork 295
DOC: easier copy-and-paste of code examples #3057
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
Comments
We actually used to have this. Looks like it stopped working. Looks like the move over to https stopped this working (diagnosed by enabling insecure scripts in the docs). The line is at https://github.com/SciTools/iris/blob/master/docs/iris/src/_templates/layout.html#L9. It would take a PR to |
@pelson Yes, I can have a look at this. |
Thanks for doing this! |
Copybutton is broken in Iris2.2, example I think I broke this in #3071. Iris2.2 code blocks: <div class="highlight-default notranslate">
<div class="highlight">
<pre>
<span></span>
... Iris2.1 code blocks: <div class="highlight-python notranslate" style="position: relative;">
<div class="highlight">
<span class="copybutton" title="Hide the prompts and output" style="cursor: pointer; position: absolute; top: 0px; right: 0px; border-color: rgb(204, 204, 204); border-style: solid; border-width: 0.994318px; color: rgb(204, 204, 204); font-family: monospace; padding-left: 0.2em; padding-right: 0.2em;">>>></span>
<pre>
... @pelson Do you want to reopen this ticket or open a new one? |
I've reopened. Are you interested in taking a look at this @tv3141? |
This may be worth looking at scipy/scipy-sphinx-theme#6. |
I believe the new Read The Docs style documentation has resolved this issue. The sphinx_copybutton extension is used to handle this. See https://scitools-iris.readthedocs.io/en/latest/installing.html for an example (note the icon on the right of the commands) Note this documentation url is the latest, this points to master. When there is a release for Iris there will also be a stable release and a tagged release too. I think we can close this issue now? |
@tkknight Awesome, job done, thanks! 👍 |
Uh oh!
There was an error while loading. Please reload this page.
Code blocks in the user guide and reference guide cannot be copied and pasted as a whole as they contain
>>>
and...
:One approach would be a toggle like numpy uses in their manual.
The text was updated successfully, but these errors were encountered: