Skip to content

Commit

Permalink
Add usage to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kayhide authored and gallais committed Aug 6, 2024
1 parent 1db94bd commit 13a4d14
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down

0 comments on commit 13a4d14

Please sign in to comment.