17a294f84ca255e13f6ff34558e25d61397866fc
[nit.git] / share / man / nitlight.md
1 # NAME
2
3 nitlight - generates HTML of highlighted code from Nit source files.
4
5 # SYNOPSIS
6
7 nitlight [*options*] FILE...
8
9 # DESCRIPTION
10
11 Unlike generic lexical or syntactic highlighter, nitlight use semantic information on programs to improve the rendered result.
12
13 # OPTIONS
14
15 Common options of the Nit tools are understood.
16 Here, only the specific one are indicated.
17
18 ### `-f`, `--fragment`
19 Omit document header and footer.
20
21 By default, a complete autonomous HTML document is generated.
22 If `-f` is given, only the inside of the body part is generated such that it could be integrated
23 into a HTML document.
24
25 ### `--line-id-prefix`
26 Prefix of the id of each line `<span>` element.
27
28 By default, each line is enclosed in its own `<span>` element with an `id` attribute made of the line number prefixed by `L` (e.g. `L1` for the first line).
29
30 This option changes the prefix used.
31 If an empty string is used, then the `<span>` are generated without `id` attributes.
32
33 This option is especially useful with `--fragment` when more than one highlighted code is
34 included in the same HTML document.
35 Each fragment can thus be generated with its own distinct prefix, or the id can be disabled altogether.
36
37 ### `--first-line`
38 Start the source file at this line (default: 1).
39
40 The generated HTML will only contains lines bellow the specified one.
41
42 ### `--last-line`
43 End the source file at this line (default: to the end).
44
45 The generated HTML will only contains lines above the specified one.
46
47 ### `-d`, `--dir`
48 Output html files in a specific directory (required if more than one module).
49
50 By default the generated HTML is outputted on the screen.
51 If this option is used, then HTML files are generated in the specified directory.
52
53 A basic `index.heml` and a `style.css` file are also generated in the directory.
54
55 ### `--full`
56 Process also imported modules.
57
58 By default, only the modules indicated on the command line are highlighted.
59
60 With the `--full` option, all imported modules (even those in standard) are also precessed.
61
62 # SEE ALSO
63
64 The Nit language documentation and the source code of its tools and libraries may be downloaded from <http://nitlanguage.org>