gurjar19 downloadsAutomatic heading numbering with burn-in for TOC/PDF/Publish, visual-only decorations, per-note control, and smart detection of existing numbers.
Automatic heading numbering for Obsidian. Numbers your headings in real time and writes them into the file so they appear in the table of contents, PDF exports, and Obsidian Publish.
1.A.a.I.i.1)auto-heading: auto to a note's front matter before it gets numbered.If you want every note in your vault numbered automatically, enable "All notes in vault" instead.
main.js, manifest.json, and styles.css from the latest release..obsidian/plugins/ and create a folder called auto-heading.To update later, repeat the same steps with the newer release files.
Auto-number (burn-in) is the default. Numbers are written into the file text. They appear in the TOC, in PDF exports, and on Obsidian Publish. The plugin updates them after each edit with a short delay. You can undo any change with Ctrl+Z.
Visual only (decoration) overlays numbers in the editor without modifying your files. Useful if you want numbering while writing but do not want it in the final output.
Off disables the plugin entirely.
Each heading level can use a different style:
| Style | Example output |
|---|---|
| Arabic | 1, 2, 3 |
| Upper letter | A, B, C |
| Lower letter | a, b, c |
| Upper Roman | I, II, III |
| Lower Roman | i, ii, iii |
With six heading levels, you can create schemes like 1.A.a.I.i.1 or keep everything as 1.1.1.
Heading indentation shifts heading lines to the right based on their depth, creating a visual tree structure that makes document hierarchy immediately obvious. This is a purely visual effect and does not modify your files.
To enable it, open plugin settings, scroll to the Appearance section, and turn on "Visual heading indentation". You can also adjust the indent size (pixels per level) and optionally enable subtle vertical guide lines that connect related heading levels.
The indentation works in both Live Preview and Reading View. A small preview in the settings panel shows how the current indent size will look.
You can control indentation on individual notes through front matter:
---
auto-heading: auto, indent
---
Or with a custom indent size:
---
auto-heading: auto, indent, indent-size 24, indent-guides
---
To disable indentation for a specific note when it is enabled globally, use no-indent:
---
auto-heading: auto, no-indent
---
Add an auto-heading key to a note's front matter to control its behavior:
---
auto-heading: auto
---
You can also pass options inline:
---
auto-heading: auto, skip-h1, first-level 2, max 4
---
Available options: auto, off, skip-h1, no-skip-h1, first-level N, max N, start-at N, style 1.A.a, sep ".", format "{n}", skip-marker text, indent, no-indent, indent-size N, indent-guides, no-indent-guides.
To exclude a single heading from numbering, add <!-- skip --> after it or right-click the heading and choose "Skip numbering".
The plugin decides which notes to number using three toggles that work with OR logic. A note is numbered if any enabled condition matches:
auto-heading: auto in their front matter.You can enable more than one toggle at the same time.
All commands operate on the current note. Access them through the command palette (Ctrl+P) or assign hotkeys in settings.
| Command | What it does |
|---|---|
| Toggle heading numbers | Turns numbering on or off for the current note |
| Enable numbering for this note | Explicitly enables numbering, overriding scope rules |
| Disable numbering for this note | Stops numbering; existing numbers stay but stop updating |
| Burn in heading numbers | Writes numbers into the file immediately |
| Remove burned-in heading numbers | Strips all numbers and disables auto-numbering |
| Force renumber all headings | Recalculates all numbers from scratch |
| Toggle skip for heading at cursor | Adds or removes a skip marker on the heading at your cursor |
| Copy headings as numbered outline | Copies a numbered outline to your clipboard |
| Save settings to front matter | Writes current settings into the note's front matter |
| Quick configure numbering | Opens a dialog to change numbering options for the current note |
If your headings already have manually typed numbers like "1. Introduction" or "A) Methods", the plugin detects them and replaces them with computed values. This detection uses confidence levels to avoid stripping content that looks like a number but is actually part of the heading, such as "6 ways to identify a problem".
Numbers written by the plugin are tagged with an invisible Unicode marker (U+2060, the Word Joiner character) so they can be identified with certainty on subsequent edits. This marker is invisible in all renderers and has no effect on text layout, exports, or copy-paste.
npm install
npm run dev # watch mode
npm run build # production build
Tests:
node tests/test-core.mjs
node tests/layer23-check.mjs
MIT