docdef/readme.md

34 lines
1 KiB
Markdown
Raw Normal View History

2026-02-23 20:16:38 +01:00
# docdef
zum Erzeugen von Dokumenten anhand von JSON-Daten
2026-10-12 19:37:42 +02:00
## Erstellung
- `tools/ivaldi build` ausführen
2026-02-23 20:16:38 +01:00
## Nutzung
Am beigefügten Beispiel `polyhedra`:
```sh
misc/conv misc/examples/polyhedra/transform-default.js misc/examples/polyhedra/data.json | build/sd -o markdown > /tmp/polyhedra-default.md
```
Der erste Teil (vor der Pipe) transformiert die rohen Daten in ein ein JSON-Dokument im `sd`-Dialekt. `build/sd -o markdown` liest dieses Dokument von der Standard-Eingabe und erzeugt die Ausgabe im Markdown-Format.
Folgende Abwandlungen sind möglich:
```sh
# Markdown-Tabelle
2026-10-12 19:37:42 +02:00
cat misc/examples/polyhedra/data.json | misc/conv misc/examples/polyhedra/transform-table.js | build/sd -o markdown > /tmp/polyhedra-table.md
2026-02-23 20:16:38 +01:00
# HTML-Liste
2026-10-12 19:37:42 +02:00
cat misc/examples/polyhedra/data.json | misc/conv misc/examples/polyhedra/transform-default.js | build/sd -o html > /tmp/polyhedra-default.html
2026-02-23 20:16:38 +01:00
# HTML-Tabelle
2026-10-12 19:37:42 +02:00
cat misc/examples/polyhedra/data.json | misc/conv misc/examples/polyhedra/transform-table.js | build/sd -o html > /tmp/polyhedra-table.html
2026-02-23 20:16:38 +01:00
```