Heading Toggler

approved

by Lord Turmoil

Easily toggle heading levels in Markdown documents with shortcuts.

β˜… 3 stars↓ 664 downloadsUpdated 1y agoMIT
View on GitHub

Heading Toggler for Obsidian

Copyright © Tony's Studio 2024


GitHub manifest version Obsidian Downloads

Overview

This plugin allows you to toggle heading levels quickly. You can bind hotkeys to increase or decrease heading levels without typing those # characters. πŸ˜€

Features

  • Increase heading level: normal text to H6, H6 to H5 ... H2 to H1.
  • Decrease heading level: H1 to H2, ... H6 to normal text.
  • Toggle heading level to H1...6: Toggle between heading and normal text.

You can bind these commands with your favorite hotkeys in the options. πŸ˜‰

Installation

From Community Plugins

  1. Go to the "Community plugins" section in the Options dialog.
  2. Browse for "Heading Toggler" and click "Install" when you find it.
  3. Go back to "Installed plugins" to enable it.

From GitHub Release

  1. Go to the release page of heading-toggler-obsidian.
  2. Download the plugin files (main.js and manifest.json).
  3. Place them in the plugin folder in the Obsidian vault, e.g. .obsidian/plugins/heading-toggler. You may need to create a new directory.
  4. Go to "Community plugins" > "Installed plugins" to enable it.

Limitations

By default, Obsidian doesn't support nested headings, which means only the H1 in the following Markdown will be rendered as expected.

# Normal H1

- ## H2 in list

> ### H3 in quotes

Therefore, this plugin won't apply nested headings and takes listing and quotes as normal text as below.

# Normal H1

## - H2 in list

### > H3 in quotes

Contributing

Improvement of this plugin is welcomed. πŸ˜‹

Project Setup

Clone the repository: heading-toggler-obsidian. If you don't want to develop it inside the Obsidian vault, you can create a link to the repository.

For Windows users, you can use mklink.

mklink /D heading-toggler path\to\your\repository

For Linux users, you can use ln.

ln -s heading-toggler path/to/your/repository

Development

This plugin is quite simple, all logics are in main.ts.

  • npm run dev: build the plugin for development.
  • npm run build: build the plugin for production.
  • npm run version: update version.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.