Pluto has a featured called โisolated cellsโ, which lets you embed one or more cells in a very minimalistic way. This is really useful if you want to use Pluto to develop a web app.
With isolated cells:
To use isolated cells, you first need to write a notebook that is hosted somewhere as HTML. This is most useful for notebooks that are hosted using PlutoSliderServer.jl, so that you can use @bind to make your web app interactive.
@bind
As an example, letโs work with the following notebook:
https://featured.plutojl.org/basic/turtles-art.html
We will use โisolated cellsโ to make the final artwork in the notebook into its own web app. Currently, the notebook looks like this:
Next, you need to find the cell IDs of the cells that you want to isolate. You can find this in the .jl notebook file, as comment before each cell.
.jl
You can also right-click on the cell in the browser, click โInspect Elementโ, and then find the wrapping pluto-cell element. The id attribute of this element is the cell ID.
pluto-cell
id
In this example, the cell IDs are:
e51d4b19-fa30-4643-8d12-407941a4757d 6deab6a2-f298-42a8-9c86-db8a2a26ac17 c668c791-9c3b-4eed-babe-9a484a88b68e
Now, we use a URL query parameter to tell Pluto to isolate these cells. Add ? to the URL, and then add isolated_cell_id=... for each cell ID, separated by &.
?
isolated_cell_id=...
&
This gives:
https://featured.plutojl.org/basic/turtles-art.html?isolated_cell_id=e51d4b19-fa30-4643-8d12-407941a4757d&isolated_cell_id=6deab6a2-f298-42a8-9c86-db8a2a26ac17&isolated_cell_id=c668c791-9c3b-4eed-babe-9a484a88b68e
Try it out! It should look like this: