How to Use File Transclusion

Heh, that’s funny to hear you say that: it’s exactly the method I’ve been using in Scrivener for years for longer-form writing. I largely use DEVONthink for short- to medium-form writing and note taking, so it’s great to be able to use the same workflow in it too.

1 Like

Doh! I should have tried that. Control-drag transcludes!

That fills in a convenience gap. I’ll use control-drag often while brainstorming in DT. Very handy.

I’m a newcomer to the idea. It’s a really powerful thing because instead of an outline topic being just a topic or a few notes, it becomes a little dossier about a story point.

A little Javascript lets me do something similar in OmniOutliner, but it’s not as freeform as transclusion. It’s also nice the incoming and outgoing links in the DT inspector recognize transclusion.

To add to your ebullience :smiley: , use Control-Command-Up/Down arrow to shift the transclusion lines (or any other lines) to different locations in the content.

2 Likes

See, now you’re just spiking the pigskin :wink:

1 Like

Right, great point. Control-Command-Up/Down will reorder lines, blocks of lines, or re-sequence transclusions.

I am indeed abuzz with ebullience. Thanks to spell check I can even spell it rite.

Hmmm… Turquise dots, not red… Oh, got it. I can spell it right.

1 Like

DT just keeps unfolding its utilities ,

Some Qs:

  • it is the annotation file that is ‘drawn in’ as the transclusion - is that correct ? (rather than the original marked-up file)
  • is it possible to change the appearance of the included Highlights in the Preview window? While I appreciate the linking back to the file the “Highlight, Utility” affords, the font is so big it distracts from the actual highlighted text

many thanks, once again

Justin

Is it possible to only transclude a section of a document? Would this be governed by some sort of anchor in the original doc.

No, this is not supported.

  • it is the annotation file that is ‘drawn in’ as the transclusion - is that correct ? (rather than the original marked-up file)

No, that is not correct (though it’s technically feasible to transclude an Annotation file). There is nothing “drawn in” in an automatic way. You choose the file to transclude. Start by typing {{ and a few letters and an autocompletion popup shows potential matches. You choose one, the name is inserted, and the braces are closed. You have now transcluded that document into the current Markdown document.

  • is it possible to change the appearance of the included Highlights in the Preview window? While I appreciate the linking back to the file the “Highlight, Utility” affords, the font is so big it distracts from the actual highlighted text

Only via adding your own CSS styling.

1 Like

The best way to understand transclusion is that it’s done in rendering. A Markdown viewer/editor supporting transclusion displays the document like any other Markdown. When it gets to a transclusion, the viewer reads the other file and processes what it finds as if it were inline in the master file.

Transclusions can include further transclusions, since each transclusion supports all of Markdown. I have not been able to find the limit. I believe I’ve tested ten levels or so. I believe any kind of wild branching in a tree of transclusions would probably work fine.

Transclusion is protected from circular references. It’s pretty solid.

Annotation files are just text or RTF files, too, which is in line with DT’s operations. Annotation files are treated as related to their parent files by DT’s user interface. Other than that, they are just document files.

Control-click-drag-and-drop is the coolest thing, which I recently learned from @BLUEFROG. That lets you drag a document from anywhere in DT into a Markdown file, creating a transclusion. From a Zettel-like pile of atomic notes, knowledge association arises.

All cool stuff.

3 Likes

That’s a cool thing. Compatible with all types of formats?

I have quickly tested on DTTG, I noticed no auto-completion of file search is appearing as it does when you link with a page with standard brackets

No. Text-based native formats like rich text, plain text, sheets, and logically Markdown docs.

Also, you can only transclude documents in the same database.

Audio, video, PDF or images are also possible.

Does it mean that transclusion with assets can replace assets internal link for markdowns when I want to build some articles?

It’s an alternative but limited (e.g. you can’t specify a title for an image that way).