# tjot

A colorize [djot](https://djot.net) terminal pager.

[![Build status](https://builds.sr.ht/~ser/tjot/.build.yml.svg)](https://builds.sr.ht/~ser/tjot/.build.yml?)
★ [Releases](https://downloads.ser1.net/software/tjot/)
★ ![Latest release](https://downloads.ser1.net/software/tjot/badges/latest_release.svg)  
[![License](https://downloads.ser1.net/software/tjot/badges/license.svg)](https://{{.Vcs}}.sr.ht/~ser/tjot/raw/LICENSE?rev=tip)
★ [Changelog](https://hg.sr.ht/~ser/tjot/browse/CHANGELOG.md?rev=tip)
★ [Software metrics](https://downloads.ser1.net/software/tjot/badges/METRICS.md)
★ [Issues](https://todo.sr.ht/~ser/tjot)
★ [Mailing List](https://lists.sr.ht/~ser/tjot)
★ [Credits](https://hg.sr.ht/~ser/tjot/browse/CREDITS.md?rev=tip)  
[![Go Report Card](https://goreportcard.com/badge/ser1.net/tjot)](https://goreportcard.com/report/ser1.net/tjot)
★ ![Code linting](https://downloads.ser1.net/software/tjot/badges/linting.svg)
★ ![Code security](https://downloads.ser1.net/software/tjot/badges/vulnerabilities.svg)
★ ![Markdown linting](https://downloads.ser1.net/software/tjot/badges/doc_linting.svg)
★ ![Unit tests](https://downloads.ser1.net/software/tjot/badges/unit_tests.svg)  
![Code coverage](https://downloads.ser1.net/software/tjot/badges/coverage.svg)
★ ![Code complexity](https://downloads.ser1.net/software/tjot/badges/complexity.svg)
★ ![ABC metrics](https://downloads.ser1.net/software/tjot/badges/abc_score.svg)
★ ![Lines of code](https://downloads.ser1.net/software/tjot/badges/loc.svg)

A terminal pager for djot documents.

- [Features](#features)
- [Usage](#usage)
- [Install](#install)
- [To-do & known bugs](https://hg.sr.ht/~ser/tjot/browse/CHANGELOG.md#todo?rev=tip)
- [Other solutions](#other-solutions)

## Features

![](https://hg.sr.ht/~ser/tjot/raw/screen.png?rev=tip)

Djot node implementation: 100%

And it's not really a pager yet; you have to dump the output to less.

### Limitations

There's only so much magic you can do in a terminal. Super and subscripts are
supported iff the terminal supports UTF-8 characters and is using a font with
those code points. Even so, Unicode does not support all characters as offset
scripts, so the things you can do with these are limited. To print a list of
supported super and subscripts, run `tjot -s`. Add `-v` to see the glyphs in
your terminal, and check that they're mapped correctly. If they aren't, there's
not much you can do about it except change your terminal font or skip the wrong
ones.

Because there are no pages, footnotes are rendered as endnotes.

See the end of the [changelog](CHANGELOG.md) for other known bugs and
limitations.

## Usage

`-h` will give you usage.

```sh
$ go run . tests/design.dj | less
...
```

or `go build` it and put the binary in your path. If no file path is provided,
`tjot` will process from STDIN.

## Install

You need [my fork of the godjot library](https://github.com/xxxserxxx/godjot) at
the moment. The current `go.mod` rewrites that module to expect it in the parent
directory. To test this:

```
$ hg clone https://hg.sr.ht/~ser/tjot
# Super fast awesome Mercurial clone
$ git clone https://github.com/xxxserxxx/godjot  
# Slow, boring git clone, booo
$ cd tjot
$ go run . <some djot file> | less
# or
$ go build .
$ ./tjot < file.dj | less
```

## Other solutions

NONE. There are no terminal renderers, this is the first and only. tjot has a
monopoly on the djot terminal rendering market.
