arrow59 downloadsExpandable inline explanations, inspired by Nicky Case's Nutshell. Click a :term to open its definition in a card beside it.
Expandable, inline explanations for your notes. Click a :term and its explanation opens in a small card right next to it, without leaving the note or scrolling to a glossary.
The name and the idea come from Nicky Case's Nutshell.
nutshell lets you explore rabbit holes without crowding out the noise of your main writing thread.
Enter/Space on a focused term opens it, and Esc closes the top card.Water forms a [:crystal]%% A solid whose atoms sit in a repeating pattern. %% when it freezes.
The definition is kept in an Obsidian comment (%% … %%) right after the term, so reading view hides it even when the plugin is off. A bare [:crystal] is a term with no definition yet.
The easy way to make one: select a word or phrase and run Nutshell: Create term from selection from the command palette. With nothing selected, it uses the word under the cursor. The card opens in edit mode so you can type the definition. You can bind the command to a hotkey in Settings → Hotkeys.
Link a term to a heading, and the card shows that heading's section:
We model the rate with a [:beta distribution](<#Beta Distribution>).
## :Beta Distribution
A probability distribution on [0, 1], shaped by two parameters α and β.
%% end %%
[:label]). Put the target in angle brackets (<#Heading With Spaces>) so spaces work.## :Beta Distribution) is a hidden definition. It is removed from the reading view of the note and only shows up in cards. Leave the colon out when linking to it. Matching ignores case.%% end %%.[:term](<Other Note#Heading>).Without the plugin, these are ordinary heading links, so your notes still read fine anywhere else.
Click the text of an open card to edit it, at the spot you clicked. Changes are written back into the note as you type: an inline term's comment, or the heading's section.
Some cards are read-only:
#heading).## :Beta and a visible ## Beta both exist, [:beta](<#Beta>) opens the hidden one.If a save fails, Nutshell says so and keeps your text in the card. A save fails when the file can't be written, when the term was changed elsewhere, or when the term has an identical twin (same label and definition) and the note changed above it since the card opened, because Nutshell can no longer tell the two apart. Reopen the card to edit it again. If the card was already closed, Nutshell tries to copy the text to the clipboard, and its notice says whether that worked.
Links in a card open in Obsidian. http and https links open in your browser, and mailto and obsidian links open in the app that handles them. Other schemes are not opened.
: headings still appear in the Outline pane.#^block) aren't supported as targets.Requires Obsidian 1.5.7 or later.
From Community Plugins: open Settings → Community plugins → Browse, search for "Nutshell", then install and enable it.
Manually: download main.js, manifest.json and styles.css from the latest release into <vault>/.obsidian/plugins/nutshell/, then enable the plugin in Settings → Community plugins.
Bug reports, ideas and pull requests are welcome.
Cmd/Ctrl+Shift+I).Development setup:
git clone https://github.com/aaronw122/obsidian-nutshell
cd obsidian-nutshell
npm install
npm run dev # rebuilds main.js on change
npm run build # type-check and production build
To test in a vault, symlink the repo folder to <vault>/.obsidian/plugins/nutshell. The Hot Reload plugin will reload it on each rebuild.
Code layout:
| File | Responsibility |
|---|---|
terms.ts |
Term syntax: parsing and writing [:label] terms |
sections.ts |
Heading definitions: finding the section a link term opens |
main.ts |
Plugin entry, reading view, popup cards, saving |
livePreview.ts |
Live Preview decorations |
cardEditor.ts |
The editor inside a card |
styles.css |
Styles: Obsidian theme colors and fonts, with plugin-defined layout sizes |
The name, the :term syntax, the hidden : heading convention, and the whole idea of expandable explanations come from Nutshell by Nicky Case. This plugin is an independent Obsidian adaptation and isn't affiliated with Nicky Case. Go read their work.
MIT © Aaron Williams