Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Block IDs ([[#^blockID]]) in Meta Bind Plugin -> Actions -> Link #494

Closed
3 tasks done
Sainath-Chilakalapudi opened this issue Jan 14, 2025 · 2 comments
Closed
3 tasks done
Labels
feature request New feature or request

Comments

@Sainath-Chilakalapudi
Copy link

Please fill out these Check-boxes

  • I checked for existing similar feature requests
  • I have read the docs and checked that the feature I am requesting is not already implemented
  • My feature request consists of only one feature

Is your Feature Request related to a Problem or Annoyance?

No response

Describe the Feature you'd like

Feature Description

I would like to request support for block-level references ([[#^blockID]]) within the open link actions configuration of the Meta Bind Plugin for Obsidian. This enhancement will allow users to directly link to block IDs in addition to the already supported formats like [[File]] and [[#title]].

Currently, the plugin supports the following formats:
[[File]] — direct file links.
[[#title]] — heading-level links within a file.

However, block-level references ([[#^blockID]]) are not currently supported. When attempting to use such references, the plugin throws the following error:
text

Error: [MB_PARSINOM] "Failed to parse. Check that your syntax is correct." caused by "expected ']]' or '|'"

1 |   [[#^topics]]
         ^ (expected ']]' or '|')

This error indicates that the parser does not currently recognize block-level references. Adding support for such references would significantly enhance the plugin's flexibility and usability when working with finer-grained content references.

Benefits

  1. Improved Navigation: Users can directly target specific blocks within their notes.
  2. Enhanced Precision: Supports workflows requiring references to specific parts of a note, rather than an entire file or heading.
  3. Consistency: Aligns with Obsidian's native support for block-level links, improving user experience and familiarity.

Alternatives

No response

Additional Context

A Quick Tutorial: How Block IDs (^blockID) Work in Obsidian

Block IDs (^blockID) are unique identifiers you can assign to specific blocks (paragraphs, list items, etc.) in your Obsidian notes. They allow you to reference or link to a specific piece of content within a file. Here’s how to create and use them:

Assign a Block ID:

  • To assign a block ID, append ^blockID (where blockID is a unique name you choose) to any block in your note. For example:
  • This is a list item with a block ID. ^topics

Reference the Block:

  • Once a block ID is assigned, you can reference it in another note by linking it like this:
  • [[FileName#^topics]]
  • This link navigates directly to the block with the ID ^topics in the file FileName.

Use with Meta Bind:
With support added to the Meta Bind plugin, you could leverage block IDs within plugin actions. For example:

actions:
  - type: open
    link: "[[#^topics]]"

This would allow you to directly open or interact with the specific block identified by the block ID in current file.

@Sainath-Chilakalapudi Sainath-Chilakalapudi added the feature request New feature or request label Jan 14, 2025
@Sainath-Chilakalapudi
Copy link
Author

Why Block IDs Are Especially Useful

Block IDs are a powerful feature in Obsidian because they allow users to pinpoint and reference any specific part of a note. This is particularly valuable in the following scenarios:

Callouts:

  • Callouts in Obsidian (e.g., tips, warnings, notes) cannot be directly referenced by default. By assigning a block ID to a specific callout, users can create precise links pointing directly to it.
  • Example:
    > [!note] This is an important multi-line callout.
    > It has a unique block ID assigned to it.
    > The block ID is not visible in reading mode.
    > ^importantNote
    
    Using the block ID ^importantNote, this callout can be directly referenced:
actions:
  - type: open
    link: "[[#^importantNote]]"

Specific Lines:

  • Without block IDs, there is no way to create a direct reference to an individual line or detailed text fragment in a note. Block IDs solve this by allowing identifiers for specific lines or paragraphs.
  • Example:
    This is a specific line of text. ^lineReference

@mProjectsCode
Copy link
Owner

Done in 0a09194

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants