Skip to content

Commit c2d9f9d

Browse files
panglesdjonludlam
authored andcommitted
Clarify odoc for authors documentation
fix #937 Signed-off-by: Paul-Elliot <[email protected]>
1 parent 577e07c commit c2d9f9d

File tree

1 file changed

+45
-40
lines changed

1 file changed

+45
-40
lines changed

doc/odoc_for_authors.mld

Lines changed: 45 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -232,36 +232,36 @@ from OCamldoc.
232232
Text within the comments can be formatted using the following markup. Firstly,
233233
the simple typesetting markup:
234234

235-
- [{b text}] bold
236-
- [{i text}] italic
237-
- [{e text}] emphasis
238-
- [{^ text}] superscript
239-
- [{_ text}] subscript
235+
- [{b <text>}] bold
236+
- [{i <text>}] italic
237+
- [{e <text>}] emphasis
238+
- [{^ <text>}] superscript
239+
- [{_ <text>}] subscript
240240

241241
{3:lists Lists}
242242
Unordered lists:
243243
{v
244-
{ul {- item}
245-
{- item}
246-
{- item}}
244+
{ul {- <item>}
245+
{- <item>}
246+
{- <item>}}
247247
v}
248248
and ordered lists:
249249
{v
250-
{ol {- item 1}
251-
{- item 2}
252-
{- item 3}}
250+
{ol {- <item 1>}
251+
{- <item 2>}
252+
{- <item 3>}}
253253
v}
254254
There is also an abbreviated syntax for lists. The above could be written:
255255
{v
256-
- item
257-
- item
258-
- item
256+
- <item>
257+
- <item>
258+
- <item>
259259
v}
260260
and
261261
{v
262-
+ item 1
263-
+ item 2
264-
+ item 3
262+
+ <item 1>
263+
+ <item 2>
264+
+ <item 3>
265265
v}
266266

267267
{3:code_blocks Code Blocks}
@@ -379,19 +379,19 @@ module type [Foo].
379379

380380
The prefixes supported are:
381381
- [module]
382-
- [module-type] (also [modtype])
382+
- [module-type] (and the equivalent deprecated prefix [modtype])
383383
- [class]
384-
- [class-type] (also [classtype])
385-
- [value] (also [val])
384+
- [class-type] (and the equivalent deprecated prefix [classtype])
385+
- [val] (and the equivalent deprecated prefix [value])
386386
- [type]
387-
- [exn] (also [exception])
387+
- [exception] (and the equivalent deprecated prefix [exn])
388388
- [method]
389-
- [constructor] (also [const])
389+
- [constructor] (and the equivalent deprecated prefix [const])
390390
- [extension]
391-
- [field] (also [recfield])
391+
- [field] (and the equivalent deprecated prefix [recfield])
392392
- [instance-variable]
393-
- [label] (also [section] - for referring to headings)
394-
- [page] (for referring to [.mld] pages)
393+
- [section] (and the equivalent deprecated prefix [label]) - for referring to headings
394+
- [page] - for referring to [.mld] pages
395395

396396
In some cases the element being referenced might have a hyphen, a dot or a space in the name,
397397
e.g. if trying to refer to a page from a [.mld] file "1.2.3.mld". In this case, the
@@ -505,22 +505,23 @@ These tags have a block of potentially marked-up text associated with them,
505505
and occasionally some more data too. The block of text is ended by the end
506506
of the comment or by another tag. They are:
507507

508-
- [@deprecated text] - marks the element as deprecated. [text] should describe
508+
- [@deprecated <text>] - marks the element as deprecated. [text] should describe
509509
when the element was deprecated, what to use as a replacement, and possibly
510510
the reason for the deprecation
511-
- [@param id text] - Associate the the given description (text) to the given
511+
- [@param <id> <text>] - Associate the the given description (text) to the given
512512
parameter name id. OCamldoc uses this tag for functions, methods, classes
513513
and functors, but [odoc] does not currently enforce this restriction.
514-
- [@raise exn text] - Indicates that the element may raise [exn]. The text should
514+
- [@raise <exn> <text>] - Indicates that the element may raise [exn]. The text should
515515
describe when this might occur. [@raises] is a synonym for this tag.
516-
- [@return text] - describes the return value. [@returns] is a synonym for this.
517-
- [@before version text] - Allows differences in past behaviour to be described.
516+
- [@return <text>] - describes the return value. [@returns] is a synonym for this.
517+
- [@before <version> <text>] - Allows differences in past behaviour to be described.
518518
This is intended to be used to document compatibility issues.
519-
- [@see < URL > text] - Add a reference to the URL with [text] as a comment.
520-
- [@see 'filename' text] - Add a reference to the given file (written between
519+
- [@see <<URL>> <text>] - Add a reference to the URL (written between [<] and
520+
[>] delimiters) with [text] as a comment.
521+
- [@see '<filename>' <text>] - Add a reference to the given file (written between
521522
single quotes), with the given text as comment. {e Note:} [odoc] currently
522523
doesn't turn this into a link in the output HTML.
523-
- [@see "document-name" text] - Adds a reference to the given document name
524+
- [@see "<document-name>" <text>] - Adds a reference to the given document name
524525
(written between double quotes), with the given text as comment. {e Note:}
525526
As with the file reference, [odoc] doesn't turn this into a link.
526527

@@ -724,23 +725,27 @@ contents and thus should be used to introduce examples, comments or other
724725
complementary notes. An alternative would be to consider splitting into
725726
multiple files.
726727

728+
Finally, documentation pages should start with a level-0 heading, see
729+
{!section-"page-title"}. Level-0 headings should not be used elsewhere.
730+
727731
The syntax for declaring sections is as follows:
728732

729733
{v
730-
{[0-6] text}
734+
{[0-5] <text>}
731735
v}
732736
or
733737
{v
734-
{[0-6]:label text}
738+
{[0-5]:<label> <text>}
735739
v}
736-
where the number represents the sectioning level. [0] is reserved for page titles
737-
for [.mld] files. [label] is an optional label for the section, allowing it to be
738-
referenced via the [{!label-...}] reference. For example:
740+
741+
where the number represents the sectioning level. [<label>] is an optional label
742+
for the section, allowing it to be referenced via the [{!section-<label>}] reference.
743+
For example:
739744

740745
{v
741746
{2:foobar Foo Bar}
742747
...
743-
See {!label-foobar} for details
748+
See {!section-foobar} for details
744749
v}
745750

746751
In this case the reference text would be "Foo Bar" so the paragraph would read
@@ -755,7 +760,7 @@ name in the reference link as follows:
755760
{v
756761
{2:foo-bar Foo Bar}
757762
...
758-
See {!label-"foo-bar"} for details
763+
See {!section-"foo-bar"} for details
759764
v}
760765

761766
You can use [_] instead of [-] to avoid this syntax.

0 commit comments

Comments
 (0)