docs: improve readme and help message

- Add example for printing output to the terminal
- Fix example for usage as CLI tool (missing -f flag)
- Add instructions in the help message for combining lexers
This commit is contained in:
Ramiro Algozino 2024-08-23 18:30:14 +02:00
parent d8ddf5d8b6
commit 176b8e9bc9
No known key found for this signature in database
GPG Key ID: 8D2626E46135BFEE
2 changed files with 11 additions and 2 deletions

View File

@ -49,9 +49,17 @@ To build from source:
## Usage as a CLI tool ## Usage as a CLI tool
Show a syntax highlighted version of a C source file in your terminal:
```shell
$ tartrazine whatever.c -l c -t catppuccin-macchiato --line-numbers -f terminal
```
Generate a standalone HTML file from a C source file with the syntax highlited:
```shell ```shell
$ tartrazine whatever.c -l c -t catppuccin-macchiato --line-numbers \ $ tartrazine whatever.c -l c -t catppuccin-macchiato --line-numbers \
--standalone -o whatever.html --standalone -f html -o whatever.html
``` ```
## Usage as a Library ## Usage as a Library

View File

@ -20,7 +20,8 @@ Usage:
Options: Options:
-f <formatter> Format to use (html, terminal, json) -f <formatter> Format to use (html, terminal, json)
-t <theme> Theme to use, see --list-themes [default: default-dark] -t <theme> Theme to use, see --list-themes [default: default-dark]
-l <lexer> Lexer (language) to use, see --list-lexers [default: autodetect] -l <lexer> Lexer (language) to use, see --list-lexers. Use more than
one lexer with "+" (e.g. jinja+yaml) [default: autodetect]
-o <output> Output file. Default is stdout. -o <output> Output file. Default is stdout.
--standalone Generate a standalone HTML file, which includes --standalone Generate a standalone HTML file, which includes
all style information. If not given, it will generate just all style information. If not given, it will generate just