Skip to content

Commit 75d5830

Browse files
committed
Medias: add documentation
Signed-off-by: Paul-Elliot <[email protected]>
1 parent 6ae32ef commit 75d5830

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
@@ -610,6 +610,33 @@ would render as
610610
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).
611611
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).
612612

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

614641
{2 Stop Comments}
615642

0 commit comments

Comments
 (0)