diff --git a/README.md b/README.md new file mode 100644 index 0000000..b0d30f3 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# 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` \ No newline at end of file