Expander

unlisted

by Sébastien Dubois

Replace variables across your vault using HTML comment markers. Supports static values and dynamic functions.

View on GitHub

Obsidian Expander

Replace variables across your Obsidian vault using HTML comment markers. Configure key-value pairs in settings, and Expander will automatically substitute them throughout your notes, and keep those updated too.

Features

  • Variable Replacement: Define key-value pairs that get expanded throughout your vault
  • Dynamic Values: Use function expressions like now().format("YYYY-MM-DD") for dynamic content
  • Update Modes: Control when expansions update
    • Auto: Updates automatically on file changes
    • Manual: Updates only via command or button
    • Once: Updates once, then never again
    • Once-and-Eject: Updates once, removes markers
  • Folder Filtering: Choose which folders to scan or ignore
  • Visual Feedback: Mode badges and refresh buttons in the editor
  • Commands: Replace values in current note or entire vault, add new expansion, ...

Quick Start

  1. Install the plugin from Obsidian Community Plugins (NOT supported yet; install manually or use BRAT)
  2. Open Settings → Expander
  3. Add a replacement (e.g., key: today, value: now().format("YYYY-MM-DD"))
  4. In your note, add:
    <!-- expand: today -->
    
  5. The value and closing tag will be automatically inserted

Syntax

Just add an opening tag - the closing tag is added automatically:

<!-- expand: key -->

After expansion:

<!-- expand: key -->value<!---->

Update mode variants:

  • <!-- expand: key --> - Auto mode (updates on file change)
  • <!-- expand-manual: key --> - Manual mode (update via command only)
  • <!-- expand-once: key --> - Once mode (fills once, never updates)
  • <!-- expand-once-and-eject: key --> - Once-and-eject mode (fills once, removes markers)

Functions

Dynamic values using function expressions:

FunctionDescriptionExample
now()Current date/timenow().format("YYYY-MM-DD")
today()Today at midnighttoday().format("MM/DD/YYYY")
format(pattern)Format datenow().format("HH:mm")
lower()Lowercasenow().format("MMMM").lower()
upper()Uppercasenow().format("MMMM").upper()
trim()Trim whitespace
replace(old, new)Replace textreplace("-", "/")

Documentation

Full documentation available at docs/.

Development

See DEVELOPMENT.md for build instructions, testing setup, and contribution guidelines.

Support

If you find this plugin useful, consider supporting my work:

License

MIT License - see LICENSE for details.

News & Updates

To stay up to date about this plugin, Obsidian in general, Personal Knowledge Management and note-taking:

Author

Created by Sébastien Dubois (@dSebastien)

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.