Hiding everything below a cell
This notebook defines a widget hide_everything_below
. When shown as the output of a cell, all subsequent cells will be hidden. You can unhide those cells by removing the widget.
👀 Reading hidden code
Example
Reveal the rest of this notebook:
👀 Reading hidden code
begin
md"""
## Example
Reveal the rest of this notebook: $(b)
"""
end
A Pluto notebook is made up of small blocks of Julia code (cells) and together they form a reactive notebook. When you change a variable, Pluto automatically re-runs the cells that refer to it. Cells can even be placed in arbitrary order - intelligent syntax analysis figures out the dependencies between them and takes care of execution.
Cells can contain arbitrary Julia code, and you can use external libraries. There are no code rewrites or wrappers, Pluto just looks at your code once before evaluation.
👀 Reading hidden code
1
x = 1
👀 Reading hidden code
123
123
👀 Reading hidden code
3
x + 2
👀 Reading hidden code
hide_everything_below =
html"""
<style>
pluto-cell.hide_everything_below ~ pluto-cell {
display: none;
}
</style>
<script>
const cell = currentScript.closest("pluto-cell")
const setclass = () => {
console.log("change!")
cell.classList.toggle("hide_everything_below", true)
}
setclass()
const observer = new MutationObserver(setclass)
observer.observe(cell, {
subtree: false,
attributeFilter: ["class"],
})
invalidation.then(() => {
observer.disconnect()
cell.classList.toggle("hide_everything_below", false)
})
</script>
""";
👀 Reading hidden code
I am hidden!
👀 Reading hidden code