Add numbers to headings in a doc with outline style numbering. For example, "1.1.2".
There are two ways to get the plugin:
- Install the latest release from Obsidian directly. Go to Settings -> Community Plugins -> Browse.
- Unzip the most recent release into your
<vault>/.obsidian/plugins/
folder. You can find the latest release at https://github.com/onlyafly/number-headings-obsidian/releases/latest.
After you have installed the plugin, make sure that the switch for "Number Headings" is turned on.
To use this plugin:
- Open the command palette (type
CMD + P
on Mac or its equivalent on other platforms). - Start typing the name of one of the actions. See below:
Action | Hotkey |
---|---|
Number all headings in document (and show options) | None by default |
Number all headings in document | None by default |
Remove numbering from all headings in document | None by default |
Save settings to front matter | None by default |
You can also assign the commands to hotkeys for easy usage.
See the settings page for the plugin for detailed instructions on the various settings you can use with the plugin.
- Added support for skipping headings using the
skip
front matter setting. See #25.
- Added option to turn off automatic numbering for specific files. See #43.
- Fixed bug where you could no longer automatically insert settings on a per document basis. See #54.
- Added support for a right parenthesis as a separator.
- Added support for Roman numerals as numbers. See #34.
- Added the 'start-at' setting to allow numbering to start at a number other than 1. See #33.
- Fixed bug where table of contents would cause Obsidian to freeze if there is no other headings. See #37.
- Fixed bug where a separator like " -" (space before a dash) would cause a loop during header updates. See #36.
- Added new command "Number all headings in document (and show options)" which shows the options dialog after numbering. Changed the old command "Number all headings in document" to number without showing the dialog. See #15.
- Fixed bug where in some situations settings were not transferred to the front matter. See #19
- Add automatic table of contents rendering
- Add first-level setting to allow skipping several heading levels
- Fixed bug where skipped headings that started with numbers would be erased
- Cleaned up explanations of front matter in settings screen.
- Improved how numbering is inserted behind the scenes, so that undo history is preserved better and works faster.
- Fixed bug where skipped headings might have separators incorrectly inserted.
- Added support for custom separators between the heading numbering and the heading text.
- Improved how headings are inserted, so that the undo history is not polluted with too many irrelevant changes.
- Simplified the front matter settings to use a single key
- Fixed some bugs where "undefined" sometimes got printed at the start of lines after user removed a heading
I was inspired partially by the Obsidian plugin https://github.com/hipstersmoothie/obsidian-plugin-toc and some of the code logic is descended from that plugin. Thanks!