Skip to content

Commit

Permalink
try to test --parent-id
Browse files Browse the repository at this point in the history
  • Loading branch information
EmileTrotignon committed May 21, 2024
1 parent 5479749 commit 1823ecd
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/pages/parent_ids.t/index.mld
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{0 Index page}

2 changes: 2 additions & 0 deletions test/pages/parent_ids.t/package.mld
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{0 Package page}

91 changes: 91 additions & 0 deletions test/pages/parent_ids.t/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
We make a 'package' mld file:

$ cat package.mld
{0 Package page}

















And we'll have a module that we'll put underneath this package page.

$ cat test.mli
type t


















$ ocamlc -c -bin-annot test.mli

$ odoc compile test.cmti -I . --parent-id package --output-dir .

$ odoc compile package.mld --parent-id package --output-dir .
$ odoc compile index.mld --parent-id package --output-dir .
$ odoc compile test_page.mld --parent-id package/Test --output-dir .



Link and generate the HTML:

$ ls
index.mld
package
package.mld
test.cmi
test.cmti
test.mli
test_page.mld
$ ls package
Test
page-index.odoc
page-package.odoc
test.odoc
$ for i in $(find . -name *.odoc); do odoc link -I . $i; done
$ for i in $(find . -name *.odocl); do odoc html-generate $i -o html; done

We should see a directory structure here where the module 'Test' is found underneath the top-level directory 'package'. Also, the contents of the
file 'package.mld' should be written to the file 'package/index.html'.

$ find html -type f | sort
html/package/Test/index.html
html/package/Test/test_page.html
html/package/index.html
html/package/package.html

Let's make sure the manpage and latex renderers work too

$ for i in $(find . --name *.odocl); do odoc man-generate $i -o man; odoc latex-generate $i -o latex; done
find: unknown predicate `--name'

$ find man -type f | sort
find: 'man': No such file or directory

$ find latex -type f | sort
find: 'latex': No such file or directory

2 changes: 2 additions & 0 deletions test/pages/parent_ids.t/test.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
type t

1 change: 1 addition & 0 deletions test/pages/parent_ids.t/test_page.mld
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{0 Page for module}

0 comments on commit 1823ecd

Please sign in to comment.