|
| 1 | + |
| 2 | + $ compile test.mli |
| 3 | + File "test.mli", line 18, characters 6-10: |
| 4 | + Reference to 'B' is ambiguous. Please specify its kind: section-B, section-B. |
| 5 | + |
| 6 | +Labels: |
| 7 | +Some are not in order because the 'doc' field appears after the rest in the output. |
| 8 | + |
| 9 | + $ odoc_print test.odocl | jq -c '.. | .["`Heading"]? | select(.) | .[1]["`Label"]' |
| 10 | + [{"`Root":[{"`RootPage":"test"},"Test"]},"B"] |
| 11 | + [{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"M"]},"D"] |
| 12 | + [{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"M"]},"B"] |
| 13 | + [{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"M"]},"C"] |
| 14 | + [{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"N"]},"B"] |
| 15 | + [{"`Root":[{"`RootPage":"test"},"Test"]},"A"] |
| 16 | + |
| 17 | +References to the labels: |
| 18 | +We expect resolved references and the heading text filled in. |
| 19 | + |
| 20 | + $ odoc_print test.odocl | jq -c '.. | .["`Reference"]? | select(.)' |
| 21 | + [{"`Resolved":{"`Identifier":{"`Label":[{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"N"]},"B"]}}},[{"`Word":"An"},"`Space",{"`Word":"other"},"`Space",{"`Word":"conflicting"},"`Space",{"`Word":"label"}]] |
| 22 | + [{"`Resolved":{"`Label":[{"`Identifier":{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"M"]}},"B"]}},[]] |
| 23 | + [{"`Resolved":{"`Identifier":{"`Label":[{"`Root":[{"`RootPage":"test"},"Test"]},"A"]}}},[{"`Word":"First"},"`Space",{"`Word":"label"}]] |
| 24 | + [{"`Resolved":{"`Identifier":{"`Label":[{"`Root":[{"`RootPage":"test"},"Test"]},"B"]}}},[{"`Word":"Floating"},"`Space",{"`Word":"label"}]] |
| 25 | + [{"`Dot":[{"`Root":["M","`TUnknown"]},"C"]},[]] |
| 26 | + [{"`Resolved":{"`Label":[{"`Identifier":{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"M"]}},"D"]}},[]] |
| 27 | + [{"`Resolved":{"`Label":[{"`Identifier":{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"M"]}},"B"]}},[]] |
| 28 | + [{"`Resolved":{"`Label":[{"`Identifier":{"`Module":[{"`Root":[{"`RootPage":"test"},"Test"]},"N"]}},"B"]}},[]] |
| 29 | + |
| 30 | + $ odoc html-generate --indent -o html test.odocl |
| 31 | + |
| 32 | +There are two references in N, one should point to a local label and the other to M. |
| 33 | + |
| 34 | + $ cat html/test/Test/N/index.html |
| 35 | + <!DOCTYPE html> |
| 36 | + <html xmlns="http://www.w3.org/1999/xhtml"> |
| 37 | + <head><title>N (test.Test.N)</title> |
| 38 | + <link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/> |
| 39 | + <meta name="generator" content="odoc %%VERSION%%"/> |
| 40 | + <meta name="viewport" content="width=device-width,initial-scale=1.0"/> |
| 41 | + <script src="../../../highlight.pack.js"></script> |
| 42 | + <script>hljs.initHighlightingOnLoad();</script> |
| 43 | + </head> |
| 44 | + <body class="odoc"> |
| 45 | + <nav class="odoc-nav"><a href="../index.html">Up</a> – |
| 46 | + <a href="../../index.html">test</a> » |
| 47 | + <a href="../index.html">Test</a> » N |
| 48 | + </nav> |
| 49 | + <header class="odoc-preamble"> |
| 50 | + <h1>Module <code><span>Test.N</span></code></h1> |
| 51 | + </header> |
| 52 | + <nav class="odoc-toc"> |
| 53 | + <ul><li><a href="#B">An other conflicting label</a></li></ul> |
| 54 | + </nav> |
| 55 | + <div class="odoc-content"> |
| 56 | + <h2 id="B"><a href="#B" class="anchor"></a>An other conflicting label</h2> |
| 57 | + <p><a href="../index.html#B">An other conflicting label</a> |
| 58 | + <a href="../index.html#B"><code>M:B</code></a> |
| 59 | + </p> |
| 60 | + </div> |
| 61 | + </body> |
| 62 | + </html> |
0 commit comments