nobiot / org-transclusion

Emacs package to enable transclusion with Org Mode
https://nobiot.github.io/org-transclusion/
GNU General Public License v3.0
938 stars 47 forks source link

Unable to transclude org files without any headings #138

Closed sjmarshy closed 2 years ago

sjmarshy commented 2 years ago

I've freshly installed org-transclusion, and am running into an issue immediately. I've double checked that the variable org-transclusion-include-first-section is set to t and it is. Equally, the org id: link works, and I can follow it with no problems. When I try to transclude the included file with a line

#+transclude: [[id:06005f7e-6a67-48e1-b786-61cb61f1966f][Pantagruel as a Specification Language]]

I get the message

No content found with "id:06005f7e-6a67-48e1-b786-61cb61f1966f".  Check the link at point 7638, line 192

The contents of the file I'm trying to transclude is as follows:

:PROPERTIES:
:ID:       06005f7e-6a67-48e1-b786-61cb61f1966f
:END:
#+title: Pantagruel as a Specification Language

Pantagruel is a small Specification Language designed to be lightweight but
expressive. It's used for specifying systems. It does nothing when it is run,
but it does check certain things about the specification hold true.

    [[id:c0f07444-4b98-4ded-865b-6d7c531ce1fc][smithPantagruel2021]]

Surprisingly, I even edited the file to have a header - just to see it working - and it still didn't work

:PROPERTIES:
:ID:       06005f7e-6a67-48e1-b786-61cb61f1966f
:END:
#+title: Pantagruel as a Specification Language

* Pantagruel as a Specification Language

Pantagruel is a small Specification Language designed to be lightweight but
expressive. It's used for specifying systems. It does nothing when it is run,
but it does check certain things about the specification hold true.

    [[id:c0f07444-4b98-4ded-865b-6d7c531ce1fc][smithPantagruel2021]]

Any ideas where I could go next to figure this out / get it working as expected?

nobiot commented 2 years ago

Hmmm. I can't reproduce the issue... Just tried with emacs -q and loading org-transclusion.

How do you add the ID to a file? Do you call org-id-get-create manually?

Do you happen to be using Org-roam? If so, one thing you could check is if you have your file listed in org-id-locations-file (it's a path to a file, which should contain all your IDs with file names where the respective ID is located). The file name may be missing. For Org-roam, you can use org-roam-update-org-id-locations to update this file.

Screenshot from 2022-03-09 22-38-27

Screenshot from 2022-03-09 22-38-22

sjmarshy commented 2 years ago

Ah - the org-roam-update-org-id-locations solved this for me - I wasn't aware of that function! Thank you very much.