Merge: introduce nit_env.sh to setup the shell environement
[nit.git] / share / man / nitdoc.md
1 # NAME
2
3 nitdoc - generates HTML pages of API documentation from Nit source files.
4
5 # SYNOPSIS
6
7 nitdoc [*options*]... FILE...
8
9 # DESCRIPTION
10
11 `nitdoc` takes one or more modules and generate HTML pages of API documentation for these modules and their imported modules.
12
13 The documentation is extracted from the comments found above the definition of modules, classes, and properties.
14
15 Internally, `nitdoc` relies on the presence of the `dot` command from the [graphviz] project.
16 If the dot program is not present or not found, no image of hierarchies are generated.
17 See option `--no-dot`.
18
19 The documentation of the Nit [standard library] is generated with this tool.
20
21   [graphviz]: http://www.graphviz.org
22   [standard library]: http://nitlanguage.org/doc/stdlib
23
24 # DOCUMENTATION FORMAT
25
26 The format of the documentation is a dialect of [markdown] that allows GitHub fences (`~~~`).
27
28 Code blocks are interpreted as snippets of Nit programs and intended to be used as examples of code.
29 When these code snippets are valid, executable and contain at least and `assert` clause, they could be automatically executed and verified.
30 See `nitunit(1)` for details.
31
32   [markdown]: http://daringfireball.net/projects/markdown
33
34 # OPTIONS
35
36 ### `-d`, `--dir`
37 Output directory.
38
39 Where the HTML files are generated.
40
41 By default, the directory is named `doc`.
42
43 ### `--source`
44 Format to link source code.
45
46 The format string is used to generated links to some parts of the source-code.
47 Use `%f` for filename, `%l` for first line, and `%L` for last line.
48
49 For instance, the [standard library] use the following value to link to files in GitHub:
50
51     "https://github.com/nitlang/nit/blob/$(git rev-parse HEAD)/%f#L%l-%L"
52
53 Here, the `git rev-parse HEAD` is used to link to the current snapshot revision of the file.
54
55 ### `--no-attributes`
56 Ignore the attributes.
57
58 Note: In Nit, attributes are private. Therefore, this option is only useful
59 when combined with `--private`.
60
61 ### `--no-dot`
62 Do not generate graphs with graphviz.
63
64 ### `--private`
65 Also generate private API.
66
67 ## CUSTOMIZATION
68
69 ### `--sharedir`
70 Directory containing nitdoc assets.
71
72 By default `$NIT_DIR/share/nitdoc/` is used.
73
74 ### `--shareurl`
75 Use shareurl instead of copy shared files.
76
77 By default, assets from the sharedir a copied into the output directory and referred with a relative path in the generated files.
78 With this option, the assets are not copied and the given URL of path is used in the generated files to locate assets.
79
80 ### `--custom-title`
81 Custom title for homepage.
82
83 ### `--custom-footer-text`
84 Custom footer text.
85
86 ### `--custom-overview-text`
87 Custom intro text for homepage.
88
89 ### `--custom-brand`
90 Custom link to external site.
91
92 ## SERVICES
93
94 ### `--github-upstream`
95 Git branch where edited commits will be pulled into (ex: user:repo:branch).
96
97 ### `--github-base-sha1`
98 Git sha1 of base commit used to create pull request.
99
100 ### `--github-gitdir`
101 Git working directory used to resolve path name (ex: /home/me/myproject/).
102
103 ### `--piwik-tracker`
104 Piwik tracker URL (ex: `nitlanguage.org/piwik/`).
105
106 ### `--piwik-site-id`
107 Piwik site ID.
108
109 ## TESTING
110
111 ### `--test`
112 Print test data (metrics and structure).
113
114 ### `--no-render`
115 Do not render HTML files.
116
117 # SEE ALSO
118
119 The Nit language documentation and the source code of its tools and libraries may be downloaded from <http://nitlanguage.org>