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

Add Tag-based Cell Style UI #39

Open
bollwyvl opened this issue Dec 22, 2022 · 0 comments · May be fixed by #40
Open

Add Tag-based Cell Style UI #39

bollwyvl opened this issue Dec 22, 2022 · 0 comments · May be fixed by #40
Labels
enhancement New feature or request
Milestone

Comments

@bollwyvl
Copy link
Contributor

bollwyvl commented Dec 22, 2022

Elevator Pitch

Allow a Deck author to add styling via different, discoverable cell tags:

  • Hide all inputs of this cell
  • Show the input and output side by side

References

Motivation

Despite being semantically weak, a number of ecosystem tools encourage tag use.

An author may use these tools for non-Deck presentation of notebooks. These might include useful rules that can act as "base coat" choices for slide building. As a Deck is closer to this kind of experience than "full" Notebook authoring, an author should be able to (temporarily) opt into a set of tag opinions, or build, save, and reuse their own.

Constraints

Why tags?

  • jupyterlab-fonts hoists cell/metadata/tags to the DOM in data
  • the chosen system should serve both ends of the spectrum...

Design Ideas

API Ideas

  • new tag templates could be registered via the manager API
    • or via settings defaults e.g. conf.d
    • or via discovery of a top-level key in other extensions' settings
  • tag templates can be copied from other notebooks

UI Ideas

  • in Design Tools, offer a Cell Tag picker, offer applying a tag...
  • from the current notebooks
  • from other notebooks
  • from a pre-defined set of tags
  • from scratch in "expert" mode
    • allows for creating new selectors and property values.

A fully-expanded view might appear like:

untitled dio (2)

Where, by default, the main UI is a growing list of currently in-use tags.

Data Ideas

Per-cell tags will go in cells/*/metadata/tags.

Style templates will end up in notebook/metadata/@jupyterlab/deck, perhaps of the form

styleTemplates:
  myst-nb:
    title: Myst-NB
    icon: |
      data:image/svg:...
    remove-inputs:
      title: Remove Outputs
      description: Show only the cell input
      selector: .jp-CodeCell
      styles:
        '&[jp-fonts-cell-tags*=",remove-inputs,"] .jp-InputArea':
          display: none
@bollwyvl bollwyvl added the enhancement New feature or request label Dec 22, 2022
@bollwyvl bollwyvl changed the title Add Tag-based Cell Styles Add Tag-based Cell Style UI Dec 22, 2022
@bollwyvl bollwyvl linked a pull request Dec 22, 2022 that will close this issue
13 tasks
@bollwyvl bollwyvl added this to the 0.2.0 milestone Dec 22, 2022
@bollwyvl bollwyvl modified the milestones: 0.2.0, The Future Oct 26, 2023
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

Successfully merging a pull request may close this issue.

1 participant