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

Code Cell Output Improvements (labels, captions, ...) #72

Closed
chrisjsewell opened this issue Mar 14, 2020 · 5 comments
Closed

Code Cell Output Improvements (labels, captions, ...) #72

chrisjsewell opened this issue Mar 14, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@chrisjsewell
Copy link
Member

We would like to, at a minimum, allow for code outputs such as plots and tables to
have a label and caption. Then also e.g. the other options allowed by docutils figures.

Using pasting and gluing (see b46c2f1 and #70) actually gives us a lot more flexibility in this respect, to add these options with markdown cell text.
It is basically an implementation of the Model-View-Controller pattern that I have banged on about before, so I would rather use this approach.

But for 'simpler' use cases we may also want to allow for these to be set in the metadata of the code cell, under a suitable key name:

{
  "output_format": {
    "label": "fig:myfig",
    "caption": "blah blah blah",
    "width": 400
}
@chrisjsewell chrisjsewell added the enhancement New feature or request label Mar 14, 2020
@chrisjsewell
Copy link
Member Author

Note a caveat/shortcoming of the cell metadata approach, is that you have to assume that the cell only has one output, which this metadata would be applied to. This is what is done in IPyPublish: https://ipypublish.readthedocs.io/en/latest/metadata_tags.html#cell-output-level

@choldgraf
Copy link
Member

Imo we could start with a few of the most common artifacts one would put in a document (tables and figures seem like a good start) and build roles or directives around each.

@choldgraf
Copy link
Member

This also makes me think about tangle js:

http://worrydream.com/Tangle/

I wonder if that can be inspiration for the future

@akhmerov
Copy link
Contributor

IMO this approach has a danger of bundling too much into the cell metadata.

An alternative approach would be to implement figures as containers, which would include complete cells inside them.

@chrisjsewell
Copy link
Member Author

I think the original intention of this issue was closed in #243 and https://myst-nb.readthedocs.io/en/latest/use/formatting_outputs.html#images
Although, I can certainly think of more improvements to add in the future 😄
Fell free to open another issue, or re0open with a more specific title/goal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants