You can use # in a URL to link to a specific section of a Pluto notebook. You can link to:
#
#variable_name
#function_name
#header-text
You can use Markdown hyperlinks to link to a different section of the same notebook. For example, if you define a variable fruits = ["apple", "pear"] at the top of your notebook, then you can link to it with:
fruits = ["apple", "pear"]
md""" Take a look at [the fruits variable](#fruits). """
Clicking on the link will jump straight to the definition of fruits.
fruits
You can also link to a specific section of a notebook online. For example, if your notebook is hosted at:
https://pluto.land/n/lp7p4qk7
Then I can link to sections by adding the # hash to the URL. For example, to link to the example_step variable:
example_step
https://pluto.land/n/lp7p4qk7#example_step
Or I can link to the header โAdding colorโ:
https://pluto.land/n/lp7p4qk7#Adding-color
All global variables (and functions, types, etc.) are automatically linkable in Pluto notebooks. The variable name is the link text.
Tip
You can use this to make items linkable! For example, if you want to link to a plot (which usually has no id), you can add a โdummy variableโ my_plot = 123 inside the cell that creates the plot, and then link to it with #my_plot.
my_plot = 123
#my_plot
When you hover over a Markdown header, you can click the ๐ button to copy the header id to your clipboard. This will copy a string like #Adding-color to your clipboard, which you can then paste somewhere to use as URL.
#Adding-color
When you are reading a notebook online (instead of editing on localhost), the button will copy not just the header id, but the full URL to the header, like https://pluto.land/n/lp7p4qk7#Adding-color.
Info
This feature is only available in Pluto 0.20.13 and later.