-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
When trying to override some zebraw settings, I noticed the following lines:
shiroa/packages/shiroa/templates.typ
Lines 234 to 245 in fda1a7d
| /// HTML code block supported by zebraw. | |
| show: init-with-theme(default-theme) | |
| set raw(tab-size: 114) | |
| let in-mk-raw = state("shiroa:in-mk-raw", false) | |
| let mk-raw( | |
| it, | |
| tag: "div", | |
| inline: false, | |
| ) = { | |
| theme-box(tag: tag, theme => { | |
| show: init-with-theme(theme) |
Line 235 does a regular zebraw-init (which init-with-theme is a wrapper for) as expected when using zebraw. However, mk-raw calls it again, and this is called in a show rule for every raw block:
shiroa/packages/shiroa/templates.typ
Lines 261 to 274 in fda1a7d
| show raw.where(block: false, tab-size: 114): it => context if shiroa-sys-target() == "paged" { | |
| it | |
| } else { | |
| mk-raw(it, tag: "span", inline: true) | |
| } | |
| show raw.where(block: true, tab-size: 114): it => context if shiroa-sys-target() == "paged" { | |
| rect(width: 100%, inset: (x: 4pt, y: 5pt), radius: 4pt, fill: code-extra-colors.bg, { | |
| set text(fill: code-extra-colors.fg) if code-extra-colors.fg != none | |
| set par(justify: false) | |
| with-raw-theme(theme-style.code-theme, it) | |
| }) | |
| } else { | |
| mk-raw(it) | |
| } |
Ultimately, this means that zebraw settings can not be overridden.
Is there a particular reason for doing so? zebraw-init only sets some states, so there should be no benefit from calling it repeatedly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels