Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add usage to readme #40

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading