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

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

Open
Prague2049 opened this issue Jan 3, 2024 · 4 comments
Open

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

Prague2049 opened this issue Jan 3, 2024 · 4 comments

Comments

@Prague2049
Copy link

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]]
@nobiot
Copy link
Owner

nobiot commented Jan 4, 2024

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?

@Prague2049
Copy link
Author

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]]

@nobiot
Copy link
Owner

nobiot commented Jan 6, 2024

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.

@Prague2049
Copy link
Author

Yes! Thank you for your reply!

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

No branches or pull requests

2 participants