I would love this for when I’m using the excellent D2 flowchart and diagram plugin, but I guess it would apply to many other types of code.
I have a number of D2 diagrams, which all use the same shape classes (“classes” are defined sets of formatting applied to shapes). At the moment I have to include the class definitions in every diagram code block.
Is there any way to “include” text from another note inside the code block?
So now I must do this:
```d2
classes: { link: {
shape: callout
height: 80
style: { fill: hotpink }
}
## lots of other class definitions
}
Link test.class: link
A -> B -> Link test
It would be great to do this:
```d2
![[D2 Class Definitions]]
Link test.class: link
A -> B -> Link test
Things I have tried
I tested the basic transclusion with ![[D2 Class Definitions]] but that gave an error. I also serahced around. Any ideas?