From 9a2665d7036a67fabae9a75a013fa47f84306e12 Mon Sep 17 00:00:00 2001 From: cozis Date: Thu, 5 May 2022 19:01:06 +0200 Subject: [PATCH] updated readme --- README.md | 42 +++++++++++++++++++++++++++++++----------- cli.c | 3 --- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index b24a291..a3fc097 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,44 @@ # c2html A tool to add HTML syntax highlighting to C code. +Basicaly you give `c2html` some C code as input and it classifies all the keywords, identifiers etc using `` elements, associating them with the appropriate class names. By applying the `style.css` stylesheet to the generated output, you get the highliting. If you prefer, you can write your own style. + # Installation and usage c2html comes both as a C library and a command-line utility. +## Command-line interface +By running `build.sh`, the `c2h` executable is built, which is command-line interface of c2html. + +You can highlight your C files by doing +```sh +./c2h --input file.c --output file.html +``` +This command will generate the highlighted C code. + +### --no-table +Normally, `c2h` will generate html using a `` element, where each line is a `` element. This makes the output kind of big. By using the `--no-table` option, it's possible to generate a more lightweight output where lines are splitted using `
` elements instead of using a `
`. + +You'd use it like this; +```sh +./c2h --input file.c --output file.html --no-table +``` + +### --style +The HTML comes with no styling. If you want to apply a CSS to it, you can provide to `c2h` a style file using the `--style` option followed by the name of the file. + +```sh +./c2h --input file.c --output file.html --style style.css +``` + +This will basically add a `