Obsidian plugin: Implicitly add an alias matching the first heading in a document.

Overview

Alias from heading

Aliases in Obsidian make it convenient to provide display names to document links. However, there are a few pain points:

This plugin resolves these problems in the following ways:

  • An alias is implicitly added to a document, matching the first heading in that document, regardless of heading level.
  • This alias is a suggestion when typing [[ to add a link or when opening a document with the Quick Switcher.
  • If there are duplicate aliases within the same document (derived from YAML or the heading), there will not be any duplicate link suggestions when typing [[ or when using the Quick Switcher.
  • Updating the first heading in a document will only update links to that document with a display name matching the heading. This makes it so the link display name can be customized for a particular context, but by default, the link display name will stay in sync with the heading.
  • Any aliases defined in YAML continue to behave in their standard way and do not affect the behavior of this plugin. Unlike the heading alias, updating aliases in YAML will not update the display name of any of their associated links.

Example

Without this plugin, an alias would need to be explicitly defined in YAML. It is a manual process to keep the alias in sync with the first heading in the document.

<!-- 2022-06-08-1030.md -->

---
aliases: "πŸ… Build a garden"
---

# πŸ… Build a garden

- Survey the yard
- Choose a design
- Purchase materials
- Build the frame
- Prepare the ground
- Fill the bed

With this plugin, the alias front matter is no longer needed.

<!-- 2022-06-08-1030.md -->

# πŸ… Build a garden

- Survey the yard
- Choose a design
- Purchase materials
- Build the frame
- Prepare the ground
- Fill the bed

This second document links to the first document with only the file name.

<!-- 2022-02-02-1445.md -->

# πŸ₯¬ Gardening projects

- [[2022-06-08-1030]]
- Germinate seeds
- ...

However, it is often more readable to link to the document with a friendly display name. Type [[, search for the document by its heading, and select it to insert it.

<!-- 2022-02-02-1445.md -->

# πŸ₯¬ Gardening projects

- [[2022-06-08-1030|πŸ… Build a garden]]
- Germinate seeds
- ...

Now that the display name matches the first heading of the document it links to, they stay in sync. Update the heading in the first document from πŸ… Build a garden to πŸ₯• Build a raised garden bed. Now the second document displays the change.

<!-- 2022-02-02-1445.md -->

# πŸ₯¬ Gardening projects

- [[2022-06-08-1030|πŸ₯• Build a raised garden bed]]
- Germinate seeds
- ...

If all headings are removed from the first document, any links that were kept in sync are updated so that their display name matches the file name. This behavior makes it easy to later insert a new heading while keeping any link display names in sync. It also makes the preview of the link still meaningful, in the meantime.

<!-- 2022-02-02-1445.md -->

# πŸ₯¬ Gardening projects

- [[2022-06-08-1030|2022-06-08-1030]]
- Germinate seeds
- ...

If a custom display name is wanted or none at all, just manually change it inline. It will not be kept in sync with the heading, unless it is manually changed back to match the heading.

<!-- 2022-02-02-1445.md -->

# πŸ₯¬ Gardening projects

- [[2022-06-08-1030|🌽 Garden bed]]
- Germinate seeds
- ...

Developer instructions

Read the Obsidian Sample Plugin readme and Obsidian Plugin Developer Docs to learn about how to develop, install, test, and publish this plugin.

You might also like...

An Obsidian plugin that lets you browse the web within Obsidian.

An Obsidian plugin that lets you browse the web within Obsidian.

Obsidian Web Browser An Obsidian plugin that allows you to browse the web within Obsidian using v1.0 tabs. The core functionality of the plugin, rende

Dec 28, 2022

Cardmatchinggamebyercan - A card-matching game made with Flutter.

card_matching_game_by_ercan A card-matching game. Working Demo: https://confident-austin-19dbd2.netlify.app Getting Started This project is a starting

Dec 14, 2022

Venni backend - The backend of the Venni client apps implementing the credit card payments, matching algorithms, bank transfers, trip rating system, and more.

Cloud Functions Description This repository contains the cloud functions used in the Firebase backend of the Venni apps. Local Development Setup For t

Jan 3, 2022

Automaticly parses known pocket ips patch resources, scans folders or zip files for matching roms and applies the patches.

Pocket Automaton Automaticly parses known pocket ips patch resources, scans folders or zip files for matching roms and applies the patches. Usage pock

Nov 27, 2022

A web-based application for student-tutor matching service

A web-based application for student-tutor matching service

CodeX A web-based application for student-tutor matching service This project was generated using Nx. πŸ”Ž Smart, Fast and Extensible Build System Addin

Jan 25, 2022

Import flow for Excel (.xlsx) and CSV file with automated column matching and validation.

Import flow for Excel (.xlsx) and CSV file with automated column matching and validation.

RSI react-spreadsheet-import ⚑️ A component used for importing XLS / XLSX / CSV documents built with Chakra UI. Import flow combines: πŸ“₯ Uploader βš™οΈ P

Dec 24, 2022

An algorithm for fast 2D pattern-matching with wildcards.

An algorithm for fast 2D pattern-matching with wildcards.

pattern-match-2d.js An algorithm for fast 2D pattern-matching with wildcards, with a demo app inspired by MarkovJunior (by Maxim Gumin). The algorithm

Nov 5, 2022

Science! Testing various image matching algorithms' performance on the Pinecone vector DB

Image Matching Algorithms For Use With KNN Search As part of the development of alt-text.org, it's necessary to perform large-scale fuzzy matching of

Sep 3, 2022

⚑ the first open-source redis client made with care and acessibility-first πŸš€

⚑ Redis UI The first open-source project to create an awesome and accessible UI for Redis as a native desktop application. ✨ πŸ¦„ πŸš€ How to develop loca

Dec 5, 2022
Comments
  • YAML compatibility - clarification

    YAML compatibility - clarification

    I really love the concept of this plugin because I use the "relative path to file" link format, which is practically unreadable when rendered. Lately, I've been using YAML aliases to generate a readable link.

    I need a point of clarification, however. It appears that if the "aliases" key is present in a note's YAML, the ability to link to that note from its first header is disabled. Is that the case?

    Example

    Filename: Note A
    ---
    Aliases: 
    - 'Linus'
    ---
    
    # Charlie Brown
    

    When trying to link from Note B to Note A (after installing the plugin, obviously), I can use either "Note A" or "Linus" but I cannot use "Charlie Brown". Furthermore, even if the aliases value is empty, the alias from header functionality isn't working. Are these the expected behaviors?

    Thanks, Jack

    opened by jebeaudoin 7
  • Alias from dataview?

    Alias from dataview?

    I found this plugin amidst searching for how to get rid of YAML frontmatter entirely since Obsidian treats it as a second-class citizen (e.g., no support for wikilinks) and since it looks a little ugly. This appears to allow this by no longer needing the aliases key, but I wonder if this plugin could support other ways of loading in aliases? For example, recognize a Dataview field aliases:: that acts the same way as YAML frontmatter does (including multiple aliases, but also supports the selective renaming that this plugin supports)?

    I'm a little concerned about relying on the first heading always since I have hundreds of notes that often start with a generic templated heading like # #Summary, so I'd rather be able to switch this off and still explicitly define aliases out of YAML frontmatter. (though I know this is a bit contrary to the plugin name)

    opened by ryanwwest 6
Releases(1.0.12)
Owner
Chris Basham
Chris Basham
A plugin for obsidian to focus and highlight on a specific heading in Reading mode.

Focus and Highlight A plugin for obsidian to focus on a specific paragraph in Reading mode. Features Focus on a specific heading and its children when

Bo-Yi Tsai 22 Dec 21, 2022
Obsidian plugin allowing for linking to a heading range, in the [[Page#HeaderA#HeaderB]] extended wikilink format.

Obsidian Link Heading Range Plugin This is a plugin for Obsidian (https://obsidian.md). It allows linking to a heading range, in the [[Page#HeaderA#He

Anthropologie Biblique 7 Nov 14, 2022
This is a plugin for Obsidian (https://obsidian.md). Can open document with `.html` and `.htm` file extensions.

Obsidian HTML reader Plugin This is a plugin for Obsidian (https://obsidian.md). Can open document with .html and .htm file extensions. Obsidian HTML

null 37 Dec 27, 2022
InReach is the world’s first tech platform matching LGBTQ+ people with safe, verified resources.

Explore the screenshots Β» Report a Bug Β· Request a Feature . Ask a Question Table of Contents About Built With Getting Started Prerequisites Installat

InReach 10 Jan 3, 2023
Go to Definition following alias redirections.

vscode-goto-alias Go to Definition following alias redirections. Motivation For example, in Nuxt 3 or Vitesse projects, we provide auto import for API

Anthony Fu 141 Dec 28, 2022
A plugin for Obsidian (https://obsidian.md) that adds a button to its search view for copying the Obsidian search URL.

Copy Search URL This plugin adds a button to Obsidian's search view. Clicking it will copy the Obsidian URL for the current search to the clipboard. T

Carlo Zottmann 6 Dec 26, 2022
An open-source boat display cockpit for navigation, speed, heading, and tide tables running on Raspberry Pi and accessible as a webapp through any smartphone.

An open-source boat display cockpit for navigation, speed, heading, and tide tables running on Raspberry Pi and accessible as a webapp through any smartphone

Andy 44 Dec 30, 2022
Obsidian plugin: copy document as HTML, including images

Copy as HTML Plugin for Obsidian that copies the current document to the clipboard, so it can be pasted into HTML aware application like gmail. This p

mvdkwast 18 Dec 22, 2022
Plugin to enable PDF files as first class citizens within an Obsidian vault.

Obsidian-PDF Plugin to enable PDF files as first class citizens within an Obsidian vault. What does this plugin do for me? All PDF files in your vault

Noah Cabral 16 Nov 26, 2022
An Obsidian plugin to paste Excel tables as Markdown tables in Obsidian editor.

Obsidian Excel to Markdown Table An Obsidian plugin to paste Excel tables as Markdown tables in Obsidian editor. Demo You can paste the copied Excel d

Ganessh Kumar 108 Jan 4, 2023