Skip to content

Commit 8892a68

Browse files
committed
Medias: add documentation
Signed-off-by: Paul-Elliot <[email protected]>
1 parent eb67d4e commit 8892a68

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

doc/ocamldoc_differences.mld

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ The following describes the changes between what [odoc] understands and what’s
3030

3131
{3 Improvements}
3232
- [odoc] supports writing mathematics and tables with a specific syntax.
33+
- [odoc] supports the inclusion of medias such as audio, video and image.
3334
- [odoc] has a better mechanism for disambiguating references in comments. See 'reference syntax' later in this document.
3435
- Built-in support for standalone [.mld] files. These are documents using the OCamldoc markup, but they’re rendered as distinct pages.
3536
- Structured output: [odoc] can produce output in a structured directory tree rather a set of files.

doc/odoc_for_authors.mld

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,33 @@ would render as
611611
The light syntax has the advantages of being arguably more readable for small tables, when viewing the source file directly. However, its content is restricted (for instance, no new line is allowed).
612612
The heavy syntax is easier to write, can be more readable for big tables, and supports having any kind of content inside. It does not support alignment (yet).
613613

614+
{2 Medias}
615+
616+
Odoc 2.4 introduced new markup for medias. Medias are nestable blocks,
617+
so they can be put inside lists and tables, but they cannot be
618+
inlined, for instance in a link..
619+
620+
There are currently three kinds of medias: image, audio, and
621+
video. Each of them can refer to the file either using an asset
622+
reference, or a direct link.
623+
624+
The markup is [{<media>:link}], [{<media>!ref}],
625+
[{{<media>:link}Replacement text}] and [{{<media>:ref}Replacement text}],
626+
where [<media>] is either [image], [video] or [audio].
627+
628+
The replacement text is used for backends that do not support medias
629+
(latex and man), and for when a reference is unresolved. In the case
630+
of an image, it is also used to generate an alternative text.
631+
632+
Images are clickable and links to the image file.
633+
634+
The following source:
635+
636+
{[
637+
renders as: {image:https://picsum.photos/200/300}
638+
]}
639+
640+
renders as: {image:https://picsum.photos/200/300}
614641

615642
{2 Stop Comments}
616643

0 commit comments

Comments
 (0)