Back to Notesnook

Headings

docs/help/contents/rich-text-editor/headings-and-collapsible-sections.md

3.4.10-android5.6 KB
Original Source

Headings and collapsible sections

Headings give a note its structure. Notesnook supports six levels, each one available from the toolbar, from a keyboard shortcut, or by typing # characters. Every heading also acts as a fold: click the chevron beside it and everything underneath collapses out of the way.

<!-- TODO: screenshot — a note with a collapsed Heading 2 showing the rotated chevron -->

Apply a heading

  1. Put the cursor on the line you want to turn into a heading, or select several lines.
  2. Open the {{headings}} dropdown in the toolbar — it shows the current block, either {{paragraph}} or Heading 1 to Heading 6.
  3. Choose the level you want.

Or skip the toolbar entirely:

BlockShortcut
Heading 1Ctrl+Alt+1
Heading 2Ctrl+Alt+2
Heading 3Ctrl+Alt+3
Heading 4Ctrl+Alt+4
Heading 5Ctrl+Alt+5
Heading 6Ctrl+Alt+6
Back to a paragraphCtrl+Alt+0

On macOS use Command+Option in place of Ctrl+Alt.

Applying a heading keeps the line's alignment and text direction, and clears any custom font size on the selection so the heading uses its own size.

::: info Headings are unavailable inside a code block The {{headings}} dropdown is disabled while the cursor is inside a code block, where # is an ordinary character.

:::

Type a heading with Markdown <PlanTag plan="essential" />

With Markdown shortcuts turned on, type one to six # characters followed by a space at the start of a line and it becomes a heading of that level — # for Heading 1, ###### for Heading 6. Markdown shortcuts need the Essential plan or higher, and on desktop and web they're switched off until you turn them on in {{settings}} > {{customization}} > {{editor}}.

The toolbar dropdown and the keyboard shortcuts work on every plan.

Collapse everything under a heading

Every heading with text in it has a chevron at the end of the line.

  1. Hover over the heading — the chevron fades in immediately after the last word.
  2. Click it. Everything below the heading is hidden and the chevron rotates to point right.
  3. Click it again to unfold the section.

A collapsed heading hides everything after it until the next heading of the same or a higher level. So collapsing a Heading 2 folds away the paragraphs, lists and any Heading 3 blocks that belong to it, and stops at the next Heading 2 or Heading 1.

These block types are hidden when a section is collapsed:

Nested folds are remembered: if a Heading 3 was already collapsed inside a section, expanding the parent heading leaves that inner section folded.

::: info The fold is stored in the note Collapsing a section is a change to the note's content, so the fold state is saved and syncs to your other devices. It doesn't delete or move anything — expanding the heading brings everything back exactly as it was.

:::

Keep writing after a collapsed section

Pressing Enter at the end of a collapsed heading's text doesn't push a new line into the hidden content. Notesnook adds a new paragraph after the whole collapsed section and puts the cursor there, so you can carry on writing beneath a folded chapter without unfolding it first.

Pressing Enter anywhere else in the heading behaves normally.

Headings are what the table of contents is built from.

Click the table-of-contents button in the editor's top bar. The pane opens beside the note, lists every heading as a tree, follows along as you scroll, and jumps to a heading when you click it. A note with no headings shows {{noHeadingsFound}}.

Find & replace also expands collapsed headings automatically when a match is hidden inside one.