Jlab extension for showing course levels and structure
Project description
jupyterlab_gridwidth
JupyterLab extension to
- tag cells so that they use a fraction of the width
- can replace former 'split-cell' extension in the classic notebook
Requirements
- JupyterLab >= 4.0.0
Usage
available tags:
gridwidth-1-2
(50%)gridwidth-1-3
(~33%)gridwidth-2-3
(~66%)gridwidth-1-4
gridwidth-2-4
,gridwidth-3-4
gridwidth-1-5
gridwidth-2-5
,gridwidth-3-5
,gridwidth-4-5
gridwidth-1-6
gridwidth-2-6
,gridwidth-3-6
,gridwidth-4-6
,gridwidth-5-6
palette commands
gridwidth:toggle-1-2
and so ongridwidth:cancel
to reset to full width
keyboard shortcuts
Ctrl-\ Ctrl-1 Ctrl-2
and so on; these will toggle the corresponding tag, and remove any other tag that might be presentCtrl-\ Ctrl-0
to reset to full width
other controls
since this exclusively relies on the presence of the above tags, you can also use jupyterlab's so called "Propert Inspector" feature; of course in this case you're in charge of dealing with duplicate tags...
limitations
rendering is exclusively done in CSS; converting to a non-HTML format will ruin this layout
however we will try to provide a CSS file usable with jupyter-book to preserve the layout in jb's HTML output (not yet available)
Install
To install the extension, execute:
pip install jupyterlab_gridwidth
Uninstall
To remove the extension, execute:
pip uninstall jupyterlab_gridwidth
Development install
WARNING from this point on, this is the boilerplate text that comes with the extension cookie-cutter template; it is not guaranteed to be accurate
Note: You will need NodeJS to build the extension package.
The jlpm
command is JupyterLab's pinned version of
yarn that is installed with JupyterLab. You may use
yarn
or npm
in lieu of jlpm
below.
# Clone the repo to your local environment
# Change directory to the jupyterlab_gridwidth directory
# Install package in development mode
pip install -e "."
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm build
You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.
# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm watch
# Run JupyterLab in another terminal
jupyter lab
With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).
By default, the jlpm build
command generates the source maps for this
extension to make it easier to debug using the browser dev tools. To also
generate source maps for the JupyterLab core extensions, you can run the
following command:
jupyter lab build --minimize=False
Development uninstall
pip uninstall jupyterlab_gridwidth
In development mode, you will also need to remove the symlink created by
jupyter labextension develop
command. To find its location, you can run
jupyter labextension list
to figure out where the labextensions
folder is
located. Then you can remove the symlink named jupyterlab-gridwidth
within
that folder.
Packaging the extension
See RELEASE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for jupyterlab_gridwidth-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d711f958bbc9b4f57084acd0e4bfc01e790b302c27366e6ad20c2a5f2efcbb5e |
|
MD5 | cca3731f4632fc70552286f8b729544e |
|
BLAKE2b-256 | 09e73029ce4109b79043458a9d12ac130124b22a0cf890e2a065511f3ab2de44 |
Hashes for jupyterlab_gridwidth-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ddbd7be7d0ec56ef7db29ac5b5ac0826f3a477a632674ed1fee0f4f711225d3 |
|
MD5 | babc0ce7a2b119c1f8ebef812db775dc |
|
BLAKE2b-256 | e64461ea528b437e9e174d272894b1259a5fe68e7f29e3b08e40aa7fed43e9a6 |