chore: add example

This commit is contained in:
2026-01-26 11:33:57 +01:00
parent 3a31948f02
commit d35eb9c799
2 changed files with 48 additions and 0 deletions

48
example.typ Normal file
View File

@@ -0,0 +1,48 @@
#import "/fabulous-fedlex/src/lib.typ" as ff
#let law-dir = "./law"
#ff.init-registries((
CP: (
color: rgb("#DE615C"),
data: json(law-dir + "/code_penal.json")
),
CC: (
color: rgb("#5CBDDE"),
data: json(law-dir + "/code_civil.json")
),
CO: (
color: rgb("#A95CDE"),
data: json(law-dir + "/code_obligations.json")
),
CPP: (
color: rgb("#dba74d"),
data: json(law-dir + "/code_procedure.json")
),
LPD: (
color: rgb("#9BDE5C"),
data: json(law-dir + "/lpd.json")
),
LDA: (
color: rgb("#DECC5C"),
data: json(law-dir + "/lda.json")
)
))
// Show article 13 (first one)
#ff.cite-law("CC", "art_13")
// Show second article 13
#ff.cite-law("CC", ("art_13", 1))
// Show whole path (with numbers)
#ff.cite-law("CC", "art_13", whole-path: true)
// Show article 11 of CP
#ff.cite-law("CP", "art_11")
// Only show paragraph 2
#ff.cite-law("CP", "art_11", par: 2)
// Highlight third part of second paragraph
#ff.cite-law("CP", "art_11", highlight: (1, 2))