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