-
Notifications
You must be signed in to change notification settings - Fork 197
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
Referencing output from cells #851
Comments
If literalinclude can work off of comments in RST, it would be trivial to add:
@romanlutz do you want to give it a shot and see if it works? I think it would require modifying the |
I tried this and it almost works, except that the literalinclude output starts with
We couldn't put it after the code-block starts, could we? |
Okay, nevermind, one can do literalinclude starting from line 2
The numbering of blocks doesn't start at 001 right now, though, but are rather numbered based on the index of the code block. I'll share the PR shortly and will be looking forward to feedback. |
I can reference code from a notebook using
and the resulting images using
However, it doesn't seem to be possible to reference output from code that's part of a sphinx-gallery. This would be very useful.
I did find the following in the generated
.rst
file:Perhaps if we had a dedicated output file (which we do for images) it would be possible? Thanks for considering!
Update: I found a way to hack this together in the meanwhile, but I don't particularly like it. One of the output files is the
.rst
file which includes printed output. I added the following code to my plotting python script[Amazingly, the separation of the string is necessary, otherwise
literalinclude
below will show the code, not the output!]... and then simply add the following where you show the code:
Reasons why I don't like this:
literalinclude
instead in the first place.The text was updated successfully, but these errors were encountered: