styling cells from tags #1033
Unanswered
parmentelat
asked this question in
General
Replies: 1 comment 1 reply
-
Heya, Notebooks and Markdown documents essentially have incompatible structures: Notebooks are linearly structured in to cells, e.g. Markdown documents are hierarchically structured by headings into nested sections, e.g. Code cells are essentially "leaf nodes" within the hierarchical structure, so it's possible to store their styling, |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Trying to style my notebook cells based on the presence of tags
I have the jupyterlab side working fine, and would like to get similar results in the html output of jupyter book
Here's what I can see at this point:
code cells are fine
if I set a tag, say
level_basic
on one code celli.e. its metadata looks like
{'tags' : [ 'level_basic']}
then in jb's html output the cell is contained in an element like this
so I can style those thanks to the presence of the
tag_level_basic
classmarkdown cells: not so much...
I was naively expecting to observe something similar with markdown cells
Except that it is not the case at all !
Indeed when inspecting the resulting html, it appears that there is no structuring html tag at all that would correspond to the notebook cells; so that for example 2 consecutive markdown cells appear joined in the output, with no remembrance of the initial cell sectioning
and so that's the end of the "styling based on tags" idea altogether, as far as markdown cells at least
and so I guess my question is, is this by design ? or is there any chance to amend the tool so that the output reflects the source cells ?
Beta Was this translation helpful? Give feedback.
All reactions