1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
|
Simulate a wrapped library. `A` is the entry point (eg. `Stdlib`), the other
modules are accessible through `A` (eg. `Stdlib.Int64`).
We test that the "wrapped" modules (eg. `A.B`, rendered to `html/A/B`) have their
documentation in their preamble
and that "hidden" modules (eg. `A__b`, rendered to `html/A__b`) are not rendered.
$ ocamlc -bin-annot -o a__b.cmi -c b.mli
$ ocamlc -bin-annot -o a__b.cmo -c b.ml
$ ocamlc -bin-annot -o a.cmi -c a.mli
$ ocamlc -bin-annot -o a.cmo -c a.ml
$ ocamlc -bin-annot -a -o a.cma a.cmo a__b.cmo
$ odoc compile --pkg test -o a__b.odoc -I . a__b.cmti
$ odoc compile --pkg test -o a.odoc -I . a.cmti
File "a.mli", line 4, characters 4-17:
Warning: Canonical paths must contain a dot, eg. X.Y.
$ odoc link -I . a__b.odoc
$ odoc link -I . a.odoc
$ odoc html-generate --indent -o html a.odocl
$ odoc html-generate --indent -o html a__b.odocl
$ odoc html-targets -o html a.odocl
html/test/A/index.html
html/test/A/B/index.html
$ odoc html-targets -o html a__b.odocl
html/test/A__b/index.html
$ cat html/test/A/index.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>A (test.A)</title>
<link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/>
<meta name="generator" content="odoc 2.1.1"/>
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>
<script src="../../highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body class="odoc">
<nav class="odoc-nav"><a href="../index.html">Up</a> –
<a href="../index.html">test</a> » A
</nav>
<header class="odoc-preamble"><h1>Module <code><span>A</span></code></h1>
<p>Module A.</p>
</header>
<div class="odoc-content">
<div class="odoc-spec">
<div class="spec module" id="module-B" class="anchored">
<a href="#module-B" class="anchor"></a>
<code>
<span><span class="keyword">module</span> <a href="B/index.html">B</a>
</span>
<span> : <span class="keyword">sig</span> ...
<span class="keyword">end</span>
</span>
</code>
</div>
<div class="spec-doc"><p>Module B. This paragraph is the synopsis.</p>
</div>
</div>
</div>
</body>
</html>
`A/B` should have its documentation in the preamble:
$ cat html/test/A/B/index.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>B (test.A.B)</title>
<link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/>
<meta name="generator" content="odoc 2.1.1"/>
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>
<script src="../../../highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body class="odoc">
<nav class="odoc-nav"><a href="../index.html">Up</a> –
<a href="../../index.html">test</a> » <a href="../index.html">A</a>
» B
</nav>
<header class="odoc-preamble"><h1>Module <code><span>A.B</span></code></h1>
<p>Module B. This paragraph is the synopsis.</p>
<p>This paragraph and the previous are part of the preamble.</p>
</header>
<nav class="odoc-toc">
<ul><li><a href="#an-heading">An heading</a></li></ul>
</nav>
<div class="odoc-content">
<h3 id="an-heading"><a href="#an-heading" class="anchor"></a>An heading
</h3>
<p>This paragraph is not part of the preamble. It'll be rendered in
the "content".
</p>
<div class="odoc-spec">
<div class="spec type" id="type-t" class="anchored">
<a href="#type-t" class="anchor"></a>
<code><span><span class="keyword">type</span> t</span></code>
</div>
</div>
</div>
</body>
</html>
`A__b` shouldn't render:
$ cat html/test/A__b/index.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>A__b (test.A__b)</title>
<link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/>
<meta name="generator" content="odoc 2.1.1"/>
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>
<script src="../../highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body class="odoc">
<nav class="odoc-nav"><a href="../index.html">Up</a> –
<a href="../index.html">test</a> » A__b
</nav>
<header class="odoc-preamble">
<h1>Module <code><span>A__b</span></code></h1>
</header><div class="odoc-content"></div>
</body>
</html>
|