File: run.t

package info (click to toggle)
ocaml-odoc 2.1.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,744 kB
  • sloc: ml: 37,049; makefile: 124; sh: 79
file content (106 lines) | stat: -rw-r--r-- 2,506 bytes parent folder | download
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
Check resolution works

  $ cat top1.mld
  {0 Top1}
  {!childpage-sub1}
  {!childpage:sub2}
  $ cat sub1.mld
  {0 Sub1}
  {!childmodule:M1}
  $ cat sub2.mld
  {0 Sub2}
  {!childpage:m1}
  
  $ cat m1.mld
  {0 M1}

  $ ocamlc -c -bin-annot m1.mli
  $ odoc compile top1.mld --child page-sub1 --child page-sub2
  $ odoc compile sub1.mld -I . --parent top1 --child m1
  $ odoc compile sub2.mld -I . --parent top1 --child page-m1
  $ odoc compile m1.cmti -I . --parent sub1
  $ odoc compile m1.mld -I . --parent sub2
  $ for i in *.odoc; do odoc link -I . $i; done
  $ for i in *.odocl; do odoc html-generate -o html $i; done

If everything has worked to plan, we'll have resolved references for all of the 'child' refs in the various pages. Additionally, the
references should be to the correct identifiers - so top1 should be a RootPage, sub1 is a Page, sub2 is a LeafPage, and m1 is a Root.

This is the '{!childpage-sub1}' reference
  $ odoc_print page-top1.odocl | jq '.content[1]["`Paragraph"][0]["`Reference"][0]'
  {
    "`Resolved": {
      "`Identifier": {
        "`Page": [
          {
            "Some": {
              "`Page": [
                "None",
                "top1"
              ]
            }
          },
          "sub1"
        ]
      }
    }
  }

This is the '{!childpage:sub2}' reference
  $ odoc_print page-top1.odocl | jq '.content[1]["`Paragraph"][2]["`Reference"][0]'
  {
    "`Resolved": {
      "`Identifier": {
        "`Page": [
          {
            "Some": {
              "`Page": [
                "None",
                "top1"
              ]
            }
          },
          "sub2"
        ]
      }
    }
  }

This is the '{!childmodule:M1}' reference
  $ odoc_print page-sub1.odocl | jq '.content[1]["`Paragraph"][0]["`Reference"][0]'
  {
    "`Resolved": {
      "`Identifier": {
        "`Root": [
          {
            "Some": {
              "`Page": [
                {
                  "Some": {
                    "`Page": [
                      "None",
                      "top1"
                    ]
                  }
                },
                "sub1"
              ]
            }
          },
          "M1"
        ]
      }
    }
  }

Let's also check the hierarchy of files produced:

  $ odoc support-files -o html
  $ find html -type f | sort
  html/highlight.pack.js
  html/odoc.css
  html/top1/index.html
  html/top1/sub1/M1/index.html
  html/top1/sub1/index.html
  html/top1/sub2/index.html
  html/top1/sub2/m1.html