From 13a4d14dfc98b9daca97c50e2c58c36e005a36d5 Mon Sep 17 00:00:00 2001 From: Hideaki Kawai Date: Tue, 6 Aug 2024 10:26:01 +0900 Subject: [PATCH] Add usage to readme --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/README.md b/README.md index b9700ea..243ed4a 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,41 @@ Dependencies: + [Idrall](https://github.com/alexhumphreys/idrall) library for [Dhall](https://dhall-lang.org/) bindings +# Usage + +To generate a document, a corresponding `ttm` file is required along with the `idr` file. +After a successful build, you will find them in `build/ttc/{ttc_version}`. +`ttc_version` depends on your environment. + +To generate an HTML: + +```console +$ katla html path/to/src/Foo.idr path/to/ttm/Foo.ttm > Foo.html +``` + +To generate a TeX file and a PDF: + +```console +$ katla latex path/to/src/Foo.idr path/to/ttm/Foo.ttm > Foo.tex +$ pdflatex Foo.tex +``` + +Generated TeX files may have dependencies. +Currently, they require the following packages: + +- inconsolata +- fancyvrb +- xcolor + +You can investigate potential dependencies by searching the code: + +```console +$ grep usepackage src/Katla/LaTeX.idr +``` + +Active examples of using Katla can be found in the main repository of Idris2: +https://github.com/idris-lang/Idris2/blob/main/.github/scripts/katla.sh + # Demo See [example tests](./tests/examples).