This commit is contained in:
2026-01-30 09:45:24 -10:00
parent fd0ec5aabc
commit 97747c6b5c
3 changed files with 167 additions and 74 deletions
+8 -10
View File
@@ -40,26 +40,24 @@ Hiccup represents markup as nested data structures:
;; [1], [2], [3]
;; )
;; Raw content blocks
[:raw "= Direct Typst Markup\nJust passed through"]
;; Code blocks (use :raw with :lang)
;; Code blocks (use :raw for displayed code)
[:raw {:lang "python" :block true} "print('hello')"]
;; => #raw(lang: "python", block: true, "print('hello')")
;; Math
;; Math (inline by default)
[:math "x^2 + y^2 = z^2"]
;; => $x^2 + y^2 = z^2$
;; Math (block/display)
[:math {:block true} "sum_(i=0)^n i = (n(n+1))/2"]
;; => $ sum_(i=0)^n i = (n(n+1))/2 $
;; Images
[:image {:width "50%"} "diagram.png"]
;; Images (src in attrs, no children)
[:image {:src "diagram.png" :width "50%"}]
;; => #image("diagram.png", width: 50%)
;; Links
[:link {:dest "https://typst.app"} "Typst"]
;; Links (src in attrs, child is display text)
[:link {:src "https://typst.app"} "Typst"]
;; => #link("https://typst.app")[Typst]
```
@@ -85,7 +83,7 @@ Hiccup represents markup as nested data structures:
[:heading {:level 2} "Results"]
"The result is " [:$ "x = 42"] "."
"The result is " [:math "x = 42"] "."
[:table {:columns 2}
[:strong "Input"] [:strong "Output"]