Skip to content

Commit 14a72e7

Browse files
committed
Working WIP
1 parent 66413e8 commit 14a72e7

File tree

2 files changed

+37
-44
lines changed

2 files changed

+37
-44
lines changed

test/pages/medias.t/index.mld

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
Some image:
88

9-
- Without alt text:{image!foo/caml.gif}
10-
- With an alt text: {{image!foo/caml.gif}With alt text and {b emphasis}}
9+
- Without alt text:{image!caml.gif}
10+
- With an alt text: {{image!caml.gif}With alt text and {b emphasis}}
1111
- Unresolved without alt text: {image!caqzdqzdml.gif}
1212
- Unresolved with alt text: {{image!camezfzeffl.gif}With alt text and {b emphasis}}
1313

@@ -30,4 +30,4 @@ Some image:
3030

3131
{1 Errors}
3232

33-
- Wrong qualification:{image!module-x}
33+
- This will be considered as a path to an asset:{image!module-x}

test/pages/medias.t/run.t

Lines changed: 34 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
We need to odoc-compile the package mld file, listing its children
22

3-
$ odoc compile index.mld --child asset-caml.gif
4-
File "index.mld", line 33, characters 30-38:
5-
Warning: Non-asset reference is not allowed in media target.
6-
Suggestion: Use a reference to an asset
3+
$ odoc compile index.mld --parent-id pkg1/doc/ --output-dir _odoc
74

8-
This will have produced a file called 'page-index.odoc'.
5+
$ odoc compile-asset --parent-id pkg1/doc/ --output-dir _odoc --name caml.gif
96

10-
Link and generate the HTML (forgetting the asset!):
7+
This will have produced a file called 'page-index.odoc'.
118

12-
$ odoc link page-index.odoc
13-
File "index.mld", line 12, characters 28-85:
14-
Warning: Failed to resolve reference unresolvedroot(camezfzeffl.gif) Couldn't find asset "camezfzeffl.gif"
15-
File "index.mld", line 11, characters 31-55:
16-
Warning: Failed to resolve reference unresolvedroot(caqzdqzdml.gif) Couldn't find asset "caqzdqzdml.gif"
17-
$ odoc html-generate -o html --indent --asset caml.gif page-index.odocl
9+
Link (and generate the HTML):
10+
$ odoc link -P pkg1:_odoc/pkg1/doc _odoc/pkg1/doc/page-index.odoc
11+
File "index.mld", line 33, characters 48-64:
12+
Warning: Failed to resolve reference ./module-x Path 'module-x' not found
13+
File "index.mld", line 12, characters 28-83:
14+
Warning: Failed to resolve reference ./camezfzeffl.gif Path 'camezfzeffl.gif' not found
15+
File "index.mld", line 11, characters 31-53:
16+
Warning: Failed to resolve reference ./caqzdqzdml.gif Path 'caqzdqzdml.gif' not found
17+
$ odoc html-generate -o html --indent _odoc/pkg1/doc/page-index.odocl
1818
$ odoc support-files -o html
1919

2020
To test visually, indent:
@@ -24,49 +24,42 @@ To test visually, indent:
2424
Testing the working references:
2525

2626
$ cat html/index/index.html | grep img
27-
<a href="caml.gif" class="img-link">
28-
<img src="caml.gif" alt="caml.gif"/>
29-
<a href="caml.gif" class="img-link">
30-
<img src="caml.gif" alt="With alt text and emphasis"/>
31-
<a href="https://picsum.photos/200/300" class="img-link">
32-
<img src="https://picsum.photos/200/300" alt="reference"/>
33-
<a href="https://picsum.photos/200/300" class="img-link">
34-
<img src="https://picsum.photos/200/300"
27+
cat: html/index/index.html: No such file or directory
28+
[1]
3529

3630
$ cat html/index/index.html | grep video
37-
<li><a href="#video">Video</a>
38-
</div><h2 id="video"><a href="#video" class="anchor"></a>Video</h2>
39-
<video
40-
src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm"
41-
</video>
31+
cat: html/index/index.html: No such file or directory
32+
[1]
4233

4334
$ cat html/index/index.html | grep audio
44-
<li><a href="#audio">Audio</a>
45-
</ul><h2 id="audio"><a href="#audio" class="anchor"></a>Audio</h2>
46-
<audio
47-
</audio>
35+
cat: html/index/index.html: No such file or directory
36+
[1]
4837

4938
Testing the unresolved references:
5039

5140
$ cat html/index/index.html | grep xref-unresolved
52-
<div><span class="xref-unresolved"><code>caqzdqzdml.gif</code></span>
53-
<span class="xref-unresolved">With alt text and <b>emphasis</b></span>
41+
cat: html/index/index.html: No such file or directory
42+
[1]
5443

5544
Testing latex and manpages
5645

5746
$ odoc latex-generate -o latex page-index.odocl
47+
odoc: FILE.odocl argument: no 'page-index.odocl' file or directory
48+
Usage: odoc latex-generate [OPTION]… FILE.odocl
49+
Try 'odoc latex-generate --help' or 'odoc --help' for more information.
50+
[2]
5851
$ cat latex/index.tex | grep ocamlinlinecode
59-
\ocamlinlinecode{caml.\allowbreak{}gif}
60-
\ocamlinlinecode{caqzdqzdml.\allowbreak{}gif}
61-
\ocamlinlinecode{https://picsum.\allowbreak{}photos/200/300}
62-
\ocamlinlinecode{https://upload.\allowbreak{}wikimedia.\allowbreak{}org/wikipedia/commons/f/f1/Cri\_\allowbreak{}du\_\allowbreak{}chameau.\allowbreak{}ogg}
63-
\ocamlinlinecode{https://interactive-examples.\allowbreak{}mdn.\allowbreak{}mozilla.\allowbreak{}net/media/cc0-videos/flower.\allowbreak{}webm}
64-
\ocamlinlinecode{module-x}
52+
cat: latex/index.tex: No such file or directory
53+
[1]
6554

6655
$ odoc man-generate -o man page-index.odocl
56+
odoc: FILE.odocl argument: no 'page-index.odocl' file or directory
57+
Usage: odoc man-generate [OPTION]… FILE.odocl
58+
Try 'odoc man-generate --help' or 'odoc --help' for more information.
59+
[2]
6760
$ cat man/index.3o | grep gif
68-
caml\.gif
69-
caqzdqzdml\.gif
61+
cat: man/index.3o: No such file or directory
62+
[1]
7063
$ cat man/index.3o | grep "With alt text"
71-
With alt text and \fBemphasis\fR
72-
With alt text and \fBemphasis\fR
64+
cat: man/index.3o: No such file or directory
65+
[1]

0 commit comments

Comments
 (0)