# c2html
A tool to add HTML syntax highlighting to C code.
Basically you give `c2html` some C code, and it annotates it with HTML `` elements that have class names describing the type of token.
For example, by providing it with the code
```c
int a;
```
the output is
```html
```
therefore you can apply custom color schemes by selecting the tokens from your CSS.
A default stylesheet you can use is provided in `style.css`. It's also well documented, so that you can go off and write your own!
# Index
1. [Install](#install)
1. [Supported platforms](#supported-platforms)
1. [Install the library](#install-the-library)
1. [Install the command-line interface](#install-the-command-line-interface)
1. [Usage](#usage)
1. [Using the command-line interface](#using-the-command-line-interface)
1. [--style](#--style)
1. [--prefix](#--prefix)
1. [Using the library](#using-the-library)
1. [License](#license)
# Usage
c2html comes both as a C library and a command-line utility.
## Using the command-line interface
You can highlight your C files by doing
```sh
c2html --input file.c --output file.html
```
which will read `file.c` and generate `file.html`. To know more, you can always run `c2html --help`.
### --style
The HTML comes with no styling. If you want to apply a CSS to it, you can provide to `c2html` a style file using the `--style` option followed by the name of the file.
```sh
c2html --input file.c --output file.html --style style.css
```
This will basically add a `