org-transclusion icon indicating copy to clipboard operation
org-transclusion copied to clipboard

How to get a link's tag name to update to the latest headline?

Open Prague2049 opened this issue 1 year ago • 4 comments

1.There is a org-mode file with a headline as follow:

  • Section with links :PROPERTIES: :ID: E80F0FFD-7AEE-4B4A-A9A5-17DC9B4E3663 :END: I can refer to the section with labels 2.Cite this headline in another org mode file as follows: [[id:E80F0FFD-7AEE-4B4A-A9A5-17DC9B4E3663][Section with links]] #+transclude: [[id:E80F0FFD-7AEE-4B4A-A9A5-17DC9B4E3663][Section with links]] 3.If the headline in file 1 is modified to "Section" as follows:
  • Section :PROPERTIES: :ID: E80F0FFD-7AEE-4B4A-A9A5-17DC9B4E3663 :END: I can refer to the section with labels
  1. How to get a link's tag name to update to the latest headline such as "Section" while keeping the ID the same as below in file 2? [[id:E80F0FFD-7AEE-4B4A-A9A5-17DC9B4E3663][Section]] #+transclude: [[id:E80F0FFD-7AEE-4B4A-A9A5-17DC9B4E3663][Section]]

Prague2049 avatar Jan 03 '24 10:01 Prague2049

Sorry, I don't understand all the IDs and files.

  • You have FILE1 and FILE2

  • You have sections like this:

   FILE1 (F1)
      SECTION1 (S1)

   FILE2 (F2)
      SECTION2 (S2)
  • You transclude S1 into F2 below S2 like this ("’" denotes trancluded contnent):
   F1
      S1 :tag:

   F2
      S2
      S1’ :tag:

If you have a tag to S1, S1’ will have it, too. That's how it works on my end now.

Does this describe your situation?

nobiot avatar Jan 04 '24 11:01 nobiot

Thank you for your reply. When I have a headline like s1 in FILE1, I create an ID attribute for s1 with org-id-get-create. So I can insert this s1 in FILE2 with org-roam-node-insert. when I change s1 to s2 in FILE1, is there any way to make the existing link name in FILE2 update to s2 automatically? 1.In the FILE1 file:

  • s1 :PROPERTIES: :ID: 10C1E6FA-1701-4215-B7A9-B996039B015B :END: 2.In the FILE2 file: [[id:10C1E6FA-1701-4215-B7A9-B996039B015B][s1]]
  1. In the FILE1 (After changing the headline in the file from s1 to s2)
  • s2 :PROPERTIES: :ID: 10C1E6FA-1701-4215-B7A9-B996039B015B :END: 4.In the FILE2 (I expect the link in FILE2 to automatically update as follows)? [[id:10C1E6FA-1701-4215-B7A9-B996039B015B][s2]]

Prague2049 avatar Jan 06 '24 03:01 Prague2049

Here is how I understood your question.

  1. You have FILE1 and FILE2 (both .org files).
FILE1
* H1-Title
  ID1

FILE2
* H2-Title
  ID2

  [[id:ID1][H1-Title]]

  1. You change the title of H1, eg to "H1-Title changed".

  2. You expect the link in FILE2 to automatically change to [[id:ID1][H1-Title changed]].

Your question is: Does Org-translusion have this feature?

Is this correct?

If so, the answer is: No, Org-transclusion does not have a function to do this.

You also mention Org-roam. This s not a place to discuss other packages, but as far as I know, Org-roam doesn't do this, either. Nor does Org mode.

nobiot avatar Jan 06 '24 13:01 nobiot

Yes! Thank you for your reply!

Prague2049 avatar Jan 07 '24 05:01 Prague2049