Blocks in documentation

For each code + rendered markup example, put a black border around it to
visually group them in the documentation pdf.
This commit is contained in:
Greg Shuflin 2024-08-18 23:18:04 -07:00
parent d420851864
commit f03b69fb5f
2 changed files with 4 additions and 4 deletions

Binary file not shown.

View File

@ -3,8 +3,6 @@
#show link: x => underline[*#x*] #show link: x => underline[*#x*]
#let codeblock-old(contents) = block(fill: luma(230), inset: 8pt, radius: 4pt, breakable: false, contents)
#let codeblock(contents, addl-bindings: (:), unevaled-first-line: none) = { #let codeblock(contents, addl-bindings: (:), unevaled-first-line: none) = {
let full-contents = if unevaled-first-line != none { let full-contents = if unevaled-first-line != none {
unevaled-first-line + "\n" + contents unevaled-first-line + "\n" + contents
@ -12,8 +10,10 @@
contents contents
} }
eval(contents, mode: "markup", scope: (gloss: gloss, numbered-gloss: numbered-gloss) + addl-bindings) block(stroke: 0.5pt + black, inset: 4pt, width: 100%, breakable: false)[
block(fill: luma(230), inset: 8pt, radius: 4pt, breakable: false, raw(full-contents, lang: "typst")) #eval(contents, mode: "markup", scope: (gloss: gloss, numbered-gloss: numbered-gloss) + addl-bindings)
#block(fill: luma(230), inset: 8pt, radius: 4pt, breakable: false, width: 100%, raw(full-contents, lang: "typst"))
]
} }
// Abbreviations used in this document // Abbreviations used in this document