Hiding source blocks of transcludes in the same note

What I’m trying to do

I am trying to import annotations from Zotero, display the annotations in callouts, and have the annotations available to transclude in other links.

Things I have tried

  • Import annotations directly into callouts and assign block IDs. Result: I get the callout I want; I get no duplicated content that I want; but the transcluded note includes the callout formatting that I don’t want.
  • Import annotations, assign block IDs to the annotations, and in the same note transclude the annotation into a callout. Result: I get the callout I want; I get the ability to transclude the block into other notes I want; but the content of the block is displayed twice (with one of them undesirably formatted).
  • Import annotations, assign block IDs, and transclude into callouts as in the last bullet, but attempt to hide the source blocks within comments. Result: The transcluded annotation cannot be found.

I believe I could implement a template with Templater that could build a second file during import to contain the block annotations separately from the main note, but that’s two files that need to be coordinated when reimporting annotations, which seems brittle to me.

Short example:

test.md:

[!info]
![[test#^1234]]

%% mechanism to hide this block without suppressing this block %%

info block content
^1234

%% end hide block mechanism %%

Update: Things I have tried

  • I have tried hiding the annotations with block IDs with CSS. Result: The annotations with block IDs are hidden; the annotations with block IDs are found when transcluded; but the transcluded annotations are hidden as well; no content is displayed anywhere.

test.md:

> [!info]
> ![[test#^1234]]

<div style="visibility:hidden">
info block content

^1234
</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.