···125125{1 [odoc] Documentation}
126126127127In this section [odoc] is used to generate the documentation of [odoc] and some of its dependent packages. We can make a few simplifying assumptions here:
128128-{ol {- Since we're working with one leaf package, we can assume that there can be no module name clashes in the dependencies. As such, we can afford to put all of our [.odoc] files into one directory and then hard-code the include path to be this directory. When using [odoc] in a context where there may be module name clashes, it requires more careful partitioning of output directories.
128128+{ol {- Since we're working with one leaf package, we can assume that there can be no module name clashes in the dependencies. As such, we can afford to put all of our [.odoc] files into one directory and then hardcode the include path to be this directory. When using [odoc] in a context where there may be module name clashes, it requires more careful partitioning of output directories.
129129}{- We'll do all of the compiling before any linking.
130130}}
131131···143143source path that has to be in the source tree.
144144145145Linking a file with [odoc] requires the input file and a list of include paths. As
146146-for compile, we will hard-code the include path.
146146+for compile, we will hardcode the include path.
147147148148Generating the HTML requires the input [odocl] file and an output path. We will
149149-hard-code the output path to be [html/]. In the case of implementations, a
149149+hardcode the output path to be [html/]. In the case of implementations, a
150150source file (passed via the [--source] argument) is required.
151151152152To get the number of uses of each identifier, we can use the [count-occurrences]
···313313libraries, but [odoc] itself is also separated into libraries. These two
314314sets of libraries will be documented in different sections, so we'll keep them
315315in separate lists. Moreover, [odoc] libraries will include the source code via
316316-a hard-coded path.
316316+a hardcoded path.
317317318318Additionally, we'll construct a list containing the extra documentation pages. Finally let's create a list mapping the section to its parent, which matches
319319the hierarchy declared above.