You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Doc: parent-child convention for installed packages
This convention is already in use by Odig, Voodoo and Dune. It needs to
be specified as it needs to change in order to support assets and
complex hierarchies.
Co-authored-by: Paul-Elliot <[email protected]>
Copy file name to clipboardExpand all lines: doc/parent_child_spec.mld
+35Lines changed: 35 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
{0 Parent/Child Specification}
2
2
This parent/child specification allows more flexible output support, e.g., per library documentation. See {{:https://ocaml.org/packages}ocaml.org/packages}.
3
3
4
+
{1 Rules}
5
+
4
6
The rules are;
5
7
6
8
{ul
@@ -19,6 +21,8 @@ The rules are;
19
21
{b Note:} The [--pkg <package>] option is still supported for backward compatibility in [odoc >= v2.0.0],
20
22
although it's now equivalent to specifying a parent [.mld] file.
21
23
24
+
{1 Example}
25
+
22
26
For example, let's consider [John] whose is [Doe] and [Mark]'s father. [Doe] has
23
27
children, [Max], and page [foo], whereas [Mark] has no children. That is to say,
24
28
[john.mld], [doe.mld], [mark.mld], [max.mld], [foo.ml] respectively. For instance;
@@ -157,3 +161,34 @@ and we shall get
157
161
]}
158
162
159
163
For more about [odoc] commands, simply invoke [odoc --help] in your shell.
164
+
165
+
{1 Convention for installed packages}
166
+
167
+
Locally, the build system can make arbitrary complex documentation page
168
+
hierarchies.
169
+
However, the generated HTML documentation is generally not installed as part of
170
+
a package. Instead the documentation source code made of [.mld] pages is
171
+
installed and might be used by a different driver.
172
+
173
+
{2 Convention}
174
+
175
+
In order for drivers to build consistent documentation for a package, the
176
+
following convention should be followed.
177
+
178
+
- [.mld] pages are installed in a package's [share] directory, under the
179
+
[odoc-pages] sub-directory.
180
+
- [index.mld] is the parent of every other pages. The driver can freely rename
181
+
this page, for example, it can be named after the package.
182
+
- Other pages are children of the [index.mld] page.
183
+
184
+
If no [index.mld] is installed, it's the driver's responsibility to generate
185
+
it.
186
+
187
+
When the rendering of source code is enabled, the source tree will be named
188
+
[source] and will be a child of [index.mld]. As a consequence, no page can be
0 commit comments