Jupytag
Quickly add custom tags to Jupyter notebook cells using keyboard shortcuts.
Features
- Add custom tags to notebook cells with keyboard shortcuts
- Configure your own tags via VSCode settings
- Tags are saved to the
.ipynb file metadata
Usage
- Open VSCode Settings (
Ctrl+, or Cmd+,)
- Search for "jupytag"
- Edit the
jupytag.tags setting
- Add your custom tags as an array of strings:
"jupytag.tags": [
"solution",
"quiet",
"skip",
"important",
"todo"
]
Set Up Keyboard Shortcuts
This extension does not provide default keybindings to avoid conflicts. Set up your own:
- Open Keyboard Shortcuts (
Ctrl+K Ctrl+S)
- Click the file icon in the top right to edit
keybindings.json
- Add keybindings for your tags:
Example:
[
{
"key": "ctrl+shift+1",
"command": "jupytag.add.solution",
"when": "notebookEditorFocused"
},
{
"key": "ctrl+shift+2",
"command": "jupytag.add.quiet",
"when": "notebookEditorFocused"
},
{
"key": "ctrl+shift+3",
"command": "jupytag.add.skip",
"when": "notebookEditorFocused"
}
]
Command format: jupytag.add.<normalized-tag-name>
The tag name is normalized by converting to lowercase and replacing special characters with hyphens:
"solution" → jupytag.add.solution
"my tag" → jupytag.add.my-tag
"TODO_Item" → jupytag.add.todo-item
Tip: You can also use the Command Palette (Ctrl+Shift+P) and search for "Jupytag" to run commands without keybindings.
Using with nbconvert
Tags can be used with Jupyter's nbconvert to control cell execution and output:
skip - Skip execution of this cell
remove_cell - Remove the entire cell from output
remove_input - Remove only the input from output
remove_output - Remove only the output from output
Extension Settings
This extension contributes the following settings:
jupytag.tags: Array of tag names to register commands for. Can be simple strings or objects with id, tag, and label properties.
Release Notes
0.0.1
Initial release:
- Add custom tags to notebook cells
- Configure custom tags via settings
- Keyboard shortcut support