The Header Adjuster Plugin for Obsidian allows users to easily adjust the levels of headers in their Markdown documents. Users can increase or decrease header levels by a specified number of levels, either for the entire document or within a specified range of lines. The plugin also provides convenient default settings for header adjustments.
- Increase header levels by a specified number.
- Decrease header levels by a specified number.
- Adjust headers within a specified range of lines.
- Use default settings for header adjustments.
- Commands accessible from the command palette.
- Ribbon icon with options for increasing or decreasing header levels.
- Download the plugin files (
main.js
andmanifest.json
). - Place the files in your Obsidian vault's
.obsidian/plugins/obsidian-header-adjuster
directory. - Enable the Header Adjuster Plugin from the Obsidian Settings under the "Community plugins" section.
The plugin provides the following commands accessible from the command palette:
- Increase Header Level: Opens a modal to increase header levels by a specified number of levels.
- Decrease Header Level: Opens a modal to decrease header levels by a specified number of levels.
- Increase Header Level (Default): Increases header levels by the default number of levels specified in the settings.
- Decrease Header Level (Default): Decreases header levels by the default number of levels specified in the settings.
Clicking the ribbon icon opens a context menu with options to:
- Increase Header Level
- Decrease Header Level
When using the Increase Header Level or Decrease Header Level commands, a modal will prompt you to:
- Enter the number of levels to increase or decrease (or leave blank to use the default setting).
- Optionally specify the start line number.
- Optionally specify the end line number.
Access the plugin settings from the Obsidian Settings under the "Header Adjuster" section:
- Default Increase Level: The default number of levels to increase headers by.
- Default Decrease Level: The default number of levels to decrease headers by.
To increase all headers in a document by 2 levels:
- Open the command palette (
Ctrl+P
orCmd+P
). - Select "Increase Header Level".
- Enter
2
in the modal and click "Submit".
To decrease headers from line 5 to line 20 by 1 level:
- Open the command palette (
Ctrl+P
orCmd+P
). - Select "Decrease Header Level".
- Enter
1
in the modal. - Enter
5
for the start line. - Enter
20
for the end line. - Click "Submit".
To increase headers using the default setting:
- Open the command palette (
Ctrl+P
orCmd+P
). - Select "Increase Header Level (Default)".
To decrease headers using the default setting:
- Open the command palette (
Ctrl+P
orCmd+P
). - Select "Decrease Header Level (Default)".
For developers interested in contributing to the plugin:
- Clone the repository.
- Install dependencies:
npm install
. - Build the plugin:
npm run build
.
- main.ts: Main plugin code including command registration and header adjustment logic.
- HeaderAdjusterSettingTab: Class for managing plugin settings.
- LevelInputModal: Class for the modal to input header adjustment details.
After making changes, run npm run build
to compile the TypeScript code to JavaScript.
Contributions are welcome! Please submit issues and pull requests on the GitHub repository.
This plugin is licensed under the MIT License.
This documentation provides an overview of the plugin, installation instructions, usage examples, and development guidelines. Feel free to include additional details or examples as needed.