No description
Find a file
2026-04-20 11:30:34 +08:00
.gitattributes First Commit 2026-04-20 11:30:34 +08:00
.gitignore First Commit 2026-04-20 11:30:34 +08:00
LICENSE First Commit 2026-04-20 11:30:34 +08:00
main.js First Commit 2026-04-20 11:30:34 +08:00
main.ts First Commit 2026-04-20 11:30:34 +08:00
manifest.json First Commit 2026-04-20 11:30:34 +08:00
package-lock.json First Commit 2026-04-20 11:30:34 +08:00
package.json First Commit 2026-04-20 11:30:34 +08:00
README.md First Commit 2026-04-20 11:30:34 +08:00
styles.css First Commit 2026-04-20 11:30:34 +08:00
tsconfig.json First Commit 2026-04-20 11:30:34 +08:00
version-bump.mjs First Commit 2026-04-20 11:30:34 +08:00
versions.json First Commit 2026-04-20 11:30:34 +08:00

Heading 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., -2 to 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.

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)

  1. Download the latest release (main.js, manifest.json, styles.css).
  2. Create a folder named heading-level-adjust in your vault's .obsidian/plugins/ directory.
  3. Move the downloaded files into that folder.
  4. Reload Obsidian and enable the plugin in Settings > Community plugins.

For Developers

  1. Clone this repository.
  2. Run npm install to install dependencies.
  3. Run npm run build to compile the plugin.
  4. Copy main.js, manifest.json, and styles.css to 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 clean
  • Heading Level Adjust: Decrease heading level (-1) and clean
  • Heading Level Adjust: Adjust heading level (custom delta)
  • Heading Level Adjust: Clean

License

This project is licensed under the MIT License.