jupyterlab-toc icon indicating copy to clipboard operation
jupyterlab-toc copied to clipboard

How to use tags?

Open rohrkemper opened this issue 5 years ago • 11 comments

Is there a user guide where I can learn about how to use tags?

rohrkemper avatar Apr 11 '19 19:04 rohrkemper

You need to install https://github.com/jupyterlab/jupyterlab-celltags and use it to add tags to your cells. Then you can filter by tag in the table of content extension.

tomzx avatar May 25 '19 19:05 tomzx

Since jupyterlab:2.0.0 it is part of jupyterlab, You can create tags with the 'property inspector' in the toolbar on the left.

TristanK27 avatar Apr 23 '20 08:04 TristanK27

@TristanK27 do you mean to edit the Metadata for a certain cell?

{
    "tags": [
        "parameters"
    ]
}

Do you know other ways how to create tags? Like in Jupyter Notebook, with a certain GUI style, just add a tag for each cells we wanted?

Screenshot 2020-05-05 at 08 16 24

Biaggio74 avatar May 05 '20 06:05 Biaggio74

@Biaggio74 Yes there is a GUI option to do so, here you can define your own tags with the 'add tag' button and toggle them on/off for the cells where you need them: afbeelding

TristanK27 avatar May 11 '20 12:05 TristanK27

@TristanK27 my apologies for the late reply, ...how do you bring up this GUI you mentioned?

Biaggio74 avatar May 26 '20 05:05 Biaggio74

The GUI to add cell tags is in View...Show right sidebar

MaxGhenis avatar Mar 01 '21 06:03 MaxGhenis

All, the tag hide-output is not working for me in Lab 2.2.6 . Hiding the big, pink box would go a long way towards un-freaking out students. I need the JSON input to remain inside a code cell, instead of markdown, to preserve the indentation formatting.

system: Windows 10 + Firefox 90.0.2 64-bit

image

Here's the notebook metadata.

{ "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.5" } }

graphedge avatar Aug 05 '21 20:08 graphedge

@graphedge You can collapse the output and save the notebook. The collapse state will be saved (using cell metadata not tags): https://youtu.be/WgiX3ZRaTiY

fcollonval avatar Aug 06 '21 07:08 fcollonval

@fcollonval True, but the error comes back when the student accidentally runs the cell, and that doesn't help them notice actual Python (in our case) errors.

Any idea what is preventing the hide-output tag from working ?

graphedge avatar Aug 06 '21 13:08 graphedge

As far as I remember the trouble is linked to the the tag being non standard. And I don't recall a work-around.

In your specific case, you could use python to output the data in a nice format instead of using non-valid cell. Something like:

import json
json.dumps({"codeCellConfig": {"lineNumbers": True, "codeFolding": True}}, indent=4)

fcollonval avatar Aug 06 '21 14:08 fcollonval

Here's another solution. Use a markdown cell with backticks to embed "code style" formatting. markdown notes

graphedge avatar Sep 04 '21 15:09 graphedge