I’m stuck in a situation where I want to be able to access the body of a file in other files without certain styling /show rules, but I can only see two options.
#let note = (
meta: (
name: "note1",
uuid: "rupiv",
),
body: [
Note contents
],
)
#apply-style-and-display(note)
then, in the file where I want to use the body for other things,
#import "note.typ": note
// do stuff
.
The other option would be:
#let meta = (
name: "note1",
uuid: "rupiv",
)
Note contents
then to render the single-note file,
#import "note.typ": meta
#let body = include("note.typ")
#apply-style-and-display((meta: meta, body: body))
and to use the note for other things,
#import "note.typ": meta
#let body = include("note.typ")
// do stuff
.
The ergonomics of both suck. The pattern I’m looking to create would be something like:
#let meta = (
name: "note1",
uuid: "rupiv",
)
#show: apply-style.with(meta)
Note contents
then to use the note for other things,
#import "note.typ": meta, body-without-style
Unfortunately, I can’t find a way to only apply the style when the single note is being rendered rather than being imported/included without adding a bunch of boilerplate to the note itself.