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

transclusion of link within same file

Open wuqui opened this issue 4 years ago • 4 comments

When I try to transclude a heading in some other place in the same file, it doesn't work. It even seems to delete both the link and the #+transclusion: t line.

I guess that's just not supported at the moment, right? Are you planning to include this in the future?

It might seem like an obscure thing to do, but I would actually use it quite often. For example, I like doing what is sometimes called literate devops, where it's quite handy to transclude certain blocks which I need over and over again, such as small blocks to login to some remote server, without having to duplicate this information.

wuqui avatar Nov 25 '20 11:11 wuqui

Let me see what I can do....

nobiot avatar Nov 25 '20 12:11 nobiot

I had a look. Internally linking to an element within the same file seems to work as is. But with the "file" link like this [[file:path/to/itself.org::*headline][Heading]]. The source overlay's region is incorrectly identified with the current v0.0.5, but will be fixed in the next one. It will look like this: output-2020-12-05-22:11:44

Internal linking with a more "normal" syntax via fuzzy link like [[*Headline]] needs a whole new set of functions. I will consider this in the future release (I will need to slow down a bit after the next update; I will need to focus on my private stuff until April 2021).

nobiot avatar Dec 05 '20 21:12 nobiot

I had a look.

Thanks!

Internally linking to an element within the same file seems to work as is. But with the "file" link like this [[file:path/to/itself.org::*headline][Heading]].

Ah, I didn't know this. I usually insert links by relying on org-store-link so I had not realized that's the problem.

Internal linking with a more "normal" syntax via fuzzy link like [[*Headline]] needs a whole new set of functions. I will consider this in the future release (I will need to slow down a bit after the next update; I will need to focus on my private stuff until April 2021).

Okay, sure. I think since it's working using the 'file' links, it need not be a very high priority. More like a nice-to-have for things like org-store-link.

wuqui avatar Dec 06 '20 11:12 wuqui

Thank you, @wuqui!

nobiot avatar Dec 06 '20 12:12 nobiot