33 lines
809 B
Markdown
33 lines
809 B
Markdown
# Fabulous Fedlex
|
|
|
|
A Typst package to cite and display Swiss law articles
|
|
|
|
---
|
|
|
|
## Usage
|
|
|
|
```typst
|
|
#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")
|
|
),
|
|
))
|
|
|
|
#ff.cite-law("CP", "art_11")
|
|
```
|
|
|
|
See more examples in [example.typ](example.typ)
|
|
|
|
## Adding registries
|
|
|
|
To add new law registries, simply follow these steps:
|
|
1. Go to https://www.fedlex.admin.ch/
|
|
2. Find the registry you want to add
|
|
3. On the left panel, download the XML version of the document
|
|
4. Using [converter.py](converter.py), you can then convert it into the appropriate JSON format
|
|
5. Register the new registry as shown in the example, giving it a shortname (e.g. CP), and a color
|
|
6. You can then use it with `cite-law` |