Something went wrong. Try again.
The SRD, Unchained
Something went wrong. Try again.
unchained-srd shared.typ
2.6 kB · 107 lines
at trunk
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108#let u(..args) = { let size = args.at(0, default: 100%) size * 0.65em}
#let npcs-store = state("/5e/npcs", (:))#let item-store = state("/5e/items", (:))#let spell-store = state("/5e/spells", (:))
#let insert-npc( key, name: [], hit-die-num: 1, hit-die-size: 8, str: 10, dex: 10, con: 10, int: 10, wis: 10, cha: 10,) = context { let npcs = npcs-store.get() npcs.insert(key, ( name: name, str: str, dex: dex, con: con, int: int, wis: wis, cha: cha, )) npcs-store.update(npcs)}
#let base-template(content) = context { // Typopgraphy show title: set text(size: 2.2em) show heading: set block(above: u(2), below: u(1)) show heading: set par(leading: u(0.5)) show heading: set text(bottom-edge: "baseline") show heading.where(level: 1): set text(size: 2em) show heading.where(level: 2): set text(size: 1.5em) show heading.where(level: 3): set text(size: 1.5em) show heading.where(level: 4): set text(size: 1.25em)
content
[ // Data for querying #metadata(( npcs: npcs-store.final(), ))<meta.srd-data> ]}
#let sidebar = block
#let section-template(content) = { set heading(offset: 1) show heading.where(level: 3): set heading(outlined: false)
/// Typography show heading.where(level: 3): box.with( width: 100%, stroke: (bottom: 0.3pt), inset: (bottom: u(0.5)), ) // Paragraphs set par(justify: true, first-line-indent: 1em, spacing: u()) // Lists show list: set par(spacing: u())
// Figures show figure: set block(breakable: true) set figure(numbering: none) show figure: set text(weight: 500, number-type: "lining") show strong: set text(weight: 400) show figure: set align(start + top) set figure.caption(position: top) show figure.caption: strong show figure.caption: set text(size: 1.1em) show figure.where(supplement: [Sidebar]): block.with( width: 100%, inset: u(), fill: white.transparentize(20%), ) show figure.where(supplement: [Sidebar]): it => { show figure.caption: set block(width: 100%) it }
// Tables show figure.where(supplement: [Table]): it => { show table: set par(justify: false) set table(stroke: none, fill: (x, y) => { if (calc.even(y)) { white.transparentize(20%) } })
it }
content}
#let templates = ( base: base-template, section: section-template,)