nitlight: update manpage
[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 ### `--txt`
19 Generate text with ANSI coloring escape sequences.
20
21 Instead of HTML, this generate text files with ANSI escape sequence for colors.
22 The options `-f`, `--line-id-prefix` and `--ast` are ignored in this mode.
23
24 ### `-f`, `--fragment`
25 Omit document header and footer.
26
27 By default, a complete autonomous HTML document is generated.
28 If `-f` is given, only the inside of the body part is generated such that it could be integrated
29 into a HTML document.
30
31 ### `--line-id-prefix`
32 Prefix of the id of each line `<span>` element.
33
34 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).
35
36 This option changes the prefix used.
37 If an empty string is used, then the `<span>` are generated without `id` attributes.
38
39 This option is especially useful with `--fragment` when more than one highlighted code is
40 included in the same HTML document.
41 Each fragment can thus be generated with its own distinct prefix, or the id can be disabled altogether.
42
43 ### `--first-line`
44 Start the source file at this line (default: 1).
45
46 The generated HTML will only contains lines bellow the specified one.
47
48 ### `--last-line`
49 End the source file at this line (default: to the end).
50
51 The generated HTML will only contains lines above the specified one.
52
53 ### `-d`, `--dir`
54 Output html files in a specific directory (required if more than one module).
55
56 By default the generated HTML is outputted on the screen.
57 If this option is used, then HTML files are generated in the specified directory.
58
59 A basic `index.heml` and a `style.css` file are also generated in the directory.
60
61 ### `--full`
62 Process also imported modules.
63
64 By default, only the modules indicated on the command line are highlighted.
65
66 With the `--full` option, all imported modules (even those in standard) are also precessed.
67
68 ### `--ast`
69 Generate specific HTML elements for each Node of the AST.
70
71 Additional `<span>` elements are generated for each node of the AST.
72 The HTML generated can become quite large.
73
74 # SEE ALSO
75
76 The Nit language documentation and the source code of its tools and libraries may be downloaded from <http://nitlanguage.org>