From 176b8e9bc903d938ee72b024cd5c1b5ec742d106 Mon Sep 17 00:00:00 2001 From: Ramiro Algozino Date: Fri, 23 Aug 2024 18:30:14 +0200 Subject: [PATCH] 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 --- README.md | 10 +++++++++- src/main.cr | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bc420fd..04057b4 100644 --- a/README.md +++ b/README.md @@ -49,9 +49,17 @@ To build from source: ## 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 $ tartrazine whatever.c -l c -t catppuccin-macchiato --line-numbers \ - --standalone -o whatever.html + --standalone -f html -o whatever.html ``` ## Usage as a Library diff --git a/src/main.cr b/src/main.cr index a15edb9..8b92e58 100644 --- a/src/main.cr +++ b/src/main.cr @@ -20,7 +20,8 @@ Usage: Options: -f Format to use (html, terminal, json) -t Theme to use, see --list-themes [default: default-dark] - -l Lexer (language) to use, see --list-lexers [default: autodetect] + -l Lexer (language) to use, see --list-lexers. Use more than + one lexer with "+" (e.g. jinja+yaml) [default: autodetect] -o Output file. Default is stdout. --standalone Generate a standalone HTML file, which includes all style information. If not given, it will generate just