Automatic/inline update of links to headers and blocks when they are modified (no extra dialog window)

It means a rename block (similar to rename header) will be added. I understand it is confusing and will be renamed.

1 Like

@CawlinTeffid Sorry to mislead you. All this time, I had been thinking, in the works, was a feature that immediately automatically updated links to a heading when it was edited. I hadn’t seen this thread obviously. The problem I have with the context menu is forgetting to use it or accidentally editing headings. Still processing this. Oh well. Better to know than not.

It’s not your fault, I do think the trello card was poorly worded (for brevity).
Check out Block-reference-count plugin, it’s a good solution for knowing when to use the rename functionality and maybe some of that will be implemented in core.

2 Likes

Thanks. Feeling better already.

1 Like

The Block-reference-count plug-in has the problem Licat referred to when he answered me about the automatic updating of links to headers: it slows down Obsidian. I used the plug-in, and noticed that when you type there is a distinct, irritating lag before the text is rendered.

The dev went through several iterations to improve it, which he did, but a lag remained nevertheless, so I gave up on that plug-in.

I know you saw me make this comment in Discord, but I just repeat it here for others.

1 Like

@CawlinTeffid the context menu to adjust links to headers is useful if you just change one header name.

I use the Number headings plug-in, which adds a number to all of the headers and subheaders in a note. If you then add or delete only 1 header, the plug-in adjusts all the header numbers on that page, bypassing the context menu.

2 Likes

The problem for me isn’t how many headings I want to change, it’s that headings are part of the text, and I change text by selecting and typing, not by right-clicking. When I inevitably click a broken block/heading link, I suppose I’ll be able to find the text and update the link without too much work, it’ll just be an annoyance. (Just clarifying, not expecting any action.)

3 Likes

@CawlinTeffid I agree with that, and that is what I told Licat in the Discord discussion yesterday. I have used the right-click option once, even though there have been instances where I should. I just forget to do so, probably because, as you indicate, it is unnatural.

I have found a workaround that I will be using from now on since Licat has formally stated the automatic update of links to headers will not be implemented.

I have a vault with many long notes in which there are headers and subheaders. I need the Number heading plug-in to help me navigate those notes.

I also use transclusions a lot. If it is just a paragraph I want to transclude, a block reference is sufficient; even for a header with 3-4 paragraphs it is doable to transclude each one separately so as to avoid linking to the header.

But when a header has more than 4 paragraphs it is not doable. So, then I would make my transclusion link to the header and all the paragraphs below until the next header (of equal level or 1 higher) will be shown. That is where the automatic update would be required.

Merging those paragraphs into 1 big block of text to not have to link to the header is not acceptable for readability in Live Preview and Reading mode.

So, here is what can be done: place a <br> between paragraphs, which effectively merges them into 1 block of text, but the <br>, which is not visible when not in focus (at least in my set-up), renders them as separate paras in LP and Reading mode.

You can then link to/transclude that one block of text, and that way a change in the header above will not break the link.

4 Likes

You can add a block reference to a heading (I just checked after reading your post). It’s a little ugly because it takes on the heading formatting, but it is properly hidden in reading view.

1 Like

@CawlinTeffid if you use Reading mode a lot then that is fine, I guess. I am in LP all the time so I won’t use that.

Another thing to bear in mind is that in the Outline pane that block ref will also show.

1 Like

This has to be added manually right? (you need to make a hex code or a human readable ID with the format ^... next to the heading)

If you have Plugin Creases installed it will hides the block ref at heading level (and also helps render Latex and Links) in the Outline pane. It’s made by Liam Cain, now a team member, so I hope it will be incorporated into Obsidian one day. Would be a nice QoL improvement.

I’m a noob, but can the implementation be like below?

  • Treat the Heading reference just like block reference (attaching a UUID to it. This make the UX consistent.
  • Have 2 embed syntaxes, one to embed only the heading, and the other to embed the heading with its content.
1 Like

If I have # Some header %^123abc% it shows up in the outline even with the Creases plug-in enabled.

So, how can I prevent the %^123abc% to show in the Outline pane?

Yes (they can also be added via templates).

I’m probably missing out on something here, but I thought the block UUID on a header should have the format # Some header ^123abc?

With the Creases plugin the ^123abc will be hidden like below

I don’t understand the function of the 2 percentage signs % and why they need to be there?

Could you clarify this a bit? I was thinking of generating a UID for a random block and then cut and paste it to the Header. Not very elegant.

1 Like

For that you could make a date-based ID in a template, like ^{{date:YYYYMMDDHHmmss}}. You might be able to do something fancier using the Templater community plugin (which I haven’t used).

2 Likes

I looked at the Github ReadMe and thought that is what was needed. I obviously misunderstood.

You are absolutely right. Many thanks for pointing that out because that makes life a heck of a lot easier.

Wasn’t there another plug-in that generates those random 6-digit numbers with a caret in front automatically? I cannot for the life of me remeber which one it is. It is not the Templater.

There’s a Copy Block Link.
If you use it with a regular block (paragraph), it’ll generate the block ID and copy the block ref. However, with headings it doesn’t generate the block ID, and the block ref copied in clipboard is in Obsidian Heading reference format ([[Note name#Header]]). I guess I’ll submit a feature request then.

1 Like

Got it, thanks a lot. You may be a noob, but you sure know what’s going on a lot better than me who’s been using Obs since May 2020!

Anyway, an FR is a possibility, but bear in mind there are something like 1600+ FRs already. This is not meant as a negative comment because not all FRs have the same weight; it is meant as realism.

As a workaround I’ll follow your suggestion:

Once again, thanks a lot for your help and input.

1 Like