README file from
GithubHeading Level Adjust for Obsidian
A powerful and safe plugin to adjust Markdown heading levels and clean up your notes in Obsidian.
Features
1. Heading Level Adjustment
Easily promote or demote headings within your selection or the current line.
- Increase Heading Level: Converts
#to##,##to###, etc. (+1). - Decrease Heading Level: Converts
##to#,###to##, etc. (-1). - Custom Heading Level Adjust: Opens a prompt to enter a custom delta (e.g.,
-2to demote two levels at once). - Composite Commands: Combine heading adjustment and Markdown cleaning in one step.
- Increase heading level and clean: Promotes headings (+1) and then cleans the selection.
- Decrease heading level and clean: Demotes headings (-1) and then cleans the selection.
- Safety First:
- Prevents demoting below level 1 (
#). - Prevents promoting beyond level 6 (
######). - Operations are automatically cancelled if any line in the selection would violate these Markdown standards.
- Prevents demoting below level 1 (
2. Markdown Cleaning
Clean up your notes with a single command.
- Remove Dividers: Automatically strips out horizontal rules (e.g.,
---,***,___). - Compress Empty Lines: Collapses multiple consecutive empty lines into a single one.
- Flexible Scope: Works on the current selection or the entire document if nothing is selected.
Installation
From GitHub (Manual)
- Download the latest release (
main.js,manifest.json,styles.css). - Create a folder named
heading-level-adjustin your vault's.obsidian/plugins/directory. - Move the downloaded files into that folder.
- Reload Obsidian and enable the plugin in Settings > Community plugins.
For Developers
- Clone this repository.
- Run
npm installto install dependencies. - Run
npm run buildto compile the plugin. - Copy
main.js,manifest.json, andstyles.cssto your Obsidian plugins folder.
Usage
Open the Command Palette (Ctrl/Cmd + P) and search for:
Heading Level Adjust: Increase heading level (+1)(Default hotkey:Ctrl/Cmd + Shift + =)Heading Level Adjust: Decrease heading level (-1)(Default hotkey:Ctrl/Cmd + Shift + -)Heading Level Adjust: Increase heading level (+1) and cleanHeading Level Adjust: Decrease heading level (-1) and cleanHeading Level Adjust: Adjust heading level (custom delta)Heading Level Adjust: Clean
License
This project is licensed under the MIT License.