# Transclude links by tag

**URL:** <https://org-roam.discourse.group/t/transclude-links-by-tag/3486>\
**Category:** Troubleshooting\
**Created:** [June 3, 2024, 9:02am UTC](https://org-roam.discourse.group/t/transclude-links-by-tag/3486 "2024-06-03T09:02:39Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![angel](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@angel](https://org-roam.discourse.group/u/angel)\
**Post date:** [June 3, 2024, 9:02am UTC](https://org-roam.discourse.group/t/transclude-links-by-tag/3486/1 "2024-06-03T09:02:39Z")

</div>

One cool feature from denote is its ability to [transclude](https://protesilaos.com/emacs/denote#h:50160fae-6515-4d7d-9737-995ad925e64b) both links as well as content by simple regex.

Is there a gist function or equivalent plugin for org roam to get transclusion of links based on a filetag? like a main history node with automatic links to all other `:history:` tagged nodes?

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [June 3, 2024, 10:48am UTC](https://org-roam.discourse.group/t/transclude-links-by-tag/3486/2 "2024-06-03T10:48:15Z")

</div>

Why not use both? I do.

---

<div class="post-metadata">

**Author:** ![akashp](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/akashp/32/1383_2.png) [@akashp](https://org-roam.discourse.group/u/akashp)\
**Post date:** [June 3, 2024, 6:18pm UTC](https://org-roam.discourse.group/t/transclude-links-by-tag/3486/3 "2024-06-03T18:18:58Z")

</div>

Isn’t denote competing with org-roam? – I have never tried it, but I keep hearing about it.

Also I have no idea what OP is talking about – but wont your library `org-transclusion` fit his use case here ?

---

<div class="post-metadata">

**Author:** ![angel](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@angel](https://org-roam.discourse.group/u/angel)\
**Post date:** [June 3, 2024, 7:48pm UTC](https://org-roam.discourse.group/t/transclude-links-by-tag/3486/4 "2024-06-03T19:48:35Z")

</div>

From my understanding of org-transclusion, it’s more meant for showing the content of files with a link to that file. I want something more like:

```auto
#+BEGIN: roam-tags-transclude :history :headings-only
[[id:123e4567-e89b-12d3-a456-426614174000][Civil War]]
[[id:123e4567-e89b-12d3-a456-426614174000][WWI]]
[[id:123e4567-e89b-12d3-a456-426614174000][WWII]]
#+END:

```

with that block adding or removing links when filetags in the database change.

---

<div class="post-metadata">

**Author:** ![akashp](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/akashp/32/1383_2.png) [@akashp](https://org-roam.discourse.group/u/akashp)\
**Post date:** [June 3, 2024, 8:02pm UTC](https://org-roam.discourse.group/t/transclude-links-by-tag/3486/5 "2024-06-03T20:02:53Z")

</div>

Hmm that would be a really helpful feature to have - I don’t think its possible currently - as nobiot has suggested denote may be used in conjunction with org-roam… maybe you can try that,

If you want I can write a function that will print out the information like that for a tag you provide – but it wont be dynamic – meaning youd have to run the refresh very manually, I think it would be possible to create a overlay too and create a refresh mechanism but for that – but if denote would work – why not try it ?

---

<div class="post-metadata">

**Author:** ![akashp](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/akashp/32/1383_2.png) [@akashp](https://org-roam.discourse.group/u/akashp)\
**Post date:** [June 3, 2024, 8:12pm UTC](https://org-roam.discourse.group/t/transclude-links-by-tag/3486/6 "2024-06-03T20:12:34Z")

</div>

I almost forgot - if you just want to see this information dynamically - and dont want this data printed inside an org-buffer like maybe denote would do - you can use `delve` from Public Image Limited, I think its a real good tool to view your notes and create collections.

> **[GitHub - publicimageltd/delve: Delve into your org-roam zettelkasten](https://github.com/publicimageltd/delve)**
>
> Delve into your org-roam zettelkasten. Contribute to publicimageltd/delve development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![dmg](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dmg](https://org-roam.discourse.group/u/dmg)\
**Post date:** [June 4, 2024, 6:07pm UTC](https://org-roam.discourse.group/t/transclude-links-by-tag/3486/7 "2024-06-04T18:07:55Z")

</div>

> [@angel](#):
>
> One cool feature from denote is its ability to [transclude](https://protesilaos.com/emacs/denote#h:50160fae-6515-4d7d-9737-995ad925e64b) both links as well as content by simple regex.

Would you mind describing what you mean by transclude in your question?

@nobiot has already implemented

> **[GitHub - nobiot/org-transclusion: Emacs package to enable transclusion with...](https://github.com/nobiot/org-transclusion)**
>
> Emacs package to enable transclusion with Org Mode - nobiot/org-transclusion

which works well. If I remember correctly, it uses an ID or a filename.

---

<div class="post-metadata">

**Author:** ![akashp](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/akashp/32/1383_2.png) [@akashp](https://org-roam.discourse.group/u/akashp)\
**Post date:** [June 4, 2024, 6:23pm UTC](https://org-roam.discourse.group/t/transclude-links-by-tag/3486/8 "2024-06-04T18:23:03Z")

</div>

@dmg

> [@angel](#):
>
> From my understanding of org-transclusion, it’s more meant for showing the content of files with a link to that file. I want something more like:
> 
> ```auto
> #+BEGIN: roam-tags-transclude :history :headings-only
> [[id:123e4567-e89b-12d3-a456-426614174000][Civil War]]
> [[id:123e4567-e89b-12d3-a456-426614174000][WWI]]
> [[id:123e4567-e89b-12d3-a456-426614174000][WWII]]
> #+END:
> 
> ```
> 
> with that block adding or removing links when filetags in the database change.

---

<div class="post-metadata">

**Author:** ![dmg](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dmg](https://org-roam.discourse.group/u/dmg)\
**Post date:** [June 4, 2024, 6:31pm UTC](https://org-roam.discourse.group/t/transclude-links-by-tag/3486/9 "2024-06-04T18:31:40Z")

</div>

Thanks @akashp

but I still don’t get understand what @angel is wants.

---

<div class="post-metadata">

**Author:** ![akashp](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/akashp/32/1383_2.png) [@akashp](https://org-roam.discourse.group/u/akashp)\
**Post date:** [June 4, 2024, 6:33pm UTC](https://org-roam.discourse.group/t/transclude-links-by-tag/3486/10 "2024-06-04T18:33:20Z")

</div>

I think they want a list of nodes that have this tag – rather than the content thereof.  
The correct meaning of transclusion is to show the content of some other buffer in another buffer - which org-transclusion does, but denote also implements a form of transclusion – which is imo a misnomer, but it is what they want.

---

<div class="post-metadata">

**Author:** ![dmg](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dmg](https://org-roam.discourse.group/u/dmg)\
**Post date:** [June 4, 2024, 6:41pm UTC](https://org-roam.discourse.group/t/transclude-links-by-tag/3486/11 "2024-06-04T18:41:34Z")

</div>

Thanks, now I get it.

What @angel wants is an always up-to-date list of incoming links?

---

<div class="post-metadata">

**Author:** ![akashp](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/akashp/32/1383_2.png) [@akashp](https://org-roam.discourse.group/u/akashp)\
**Post date:** [June 4, 2024, 6:45pm UTC](https://org-roam.discourse.group/t/transclude-links-by-tag/3486/12 "2024-06-04T18:45:20Z")

</div>

Yes I think so, the package I referred earlier creates a buffer to show “collections” and can be reused to do this – I think denote does this in an org-buffer – I don’t know if there exists currently any mechanism outside denote to do this… in the org buffer itself.

---

<div class="post-metadata">

**Author:** ![dmg](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dmg](https://org-roam.discourse.group/u/dmg)\
**Post date:** [June 4, 2024, 6:49pm UTC](https://org-roam.discourse.group/t/transclude-links-by-tag/3486/13 "2024-06-04T18:49:25Z")

</div>

Personally, I would simply do a query to the roam db inside a babel node (using elisp, so I can get the name of the current node).

This is probably info that it is not needed to be up-to-date every time one looks at it.

---

<div class="post-metadata">

**Author:** ![angel](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@angel](https://org-roam.discourse.group/u/angel)\
**Post date:** [June 5, 2024, 7:24am UTC](https://org-roam.discourse.group/t/transclude-links-by-tag/3486/14 "2024-06-05T07:24:27Z")

</div>

I think that’s the best idea too. I’m playing around with [org-roam-ql](https://github.com/ahmed-shariff/org-roam-ql) to see if that’s what I want.
