-
Notifications
You must be signed in to change notification settings - Fork 86
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
Question: Support for generic parameters in code-cell directive? #189
Comments
Interesting - nope we don't have this support right now, but I think the way we could do it is:
|
Cool! I think trying to match the In principle the pattern could be expanded to support both code cells and their outputs, providing a nice shorthand for/alternative to the
A pattern like this would allow the author to be able to independently reference both the cell itself and it's output (i.e. the generated figure) independently in the text, without the need for adding any Of course, you'd have to be careful with an approach like this so as not to get too heavy on the metadata, but IMO it would be a nice feature. |
Should the figure caption support markup? It would make sense that it should (e.g. using math in the figure caption is quite common). That, on the other hand, would mean that the directive attributes need to be accessible to the parser, if the figure caption is to be provided via cell parameters. |
Ideally, yes - the options for the MyST directives do, and it would be great if the |
Note, this is essentially a duplicate of #72 |
With almost a complete overlap and duplication of the discussion - thanks for pointing this out! |
sooo do folks mind if I close this one? :-) |
@rossbar see https://myst-nb.readthedocs.io/en/latest/use/formatting_outputs.html#images 😄 So I'm going to close this, but feel free to open any more specific issues about supporting certain parameters (like for inputs cells) |
I'm not sure whether this is the right place to ask, so please bear with me!
I find myself using the
{code-block}
directive quite often to illustrate code examples. One particularly nice feature is the seamless integration of things like labels and references with sphinx. For example, I can do something like:Then subsequently reference the block like
{numref}`code:my_example`
in the text cross-reference the code block. I am curious if there is (either currently or planned to be) support for these generic parameters (name:
andcaption:
) in thecode-cell
directive. It would be great if there were a directive that behaved just like{code-block}
does, but includes the additional functionality of being executable as well.I was looking through the MyST-NB docs and didn't see anything related to this - if I've missed something (or am looking in the wrong place) please let me know!
The text was updated successfully, but these errors were encountered: