Skip to content

Commit 13f6fc4

Browse files
committed
Media: add documentation
1 parent 33d77b3 commit 13f6fc4

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
@@ -629,6 +629,33 @@ would render as
629629
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).
630630
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).
631631

632+
{2 Medias}
633+
634+
Odoc 3.0 introduced new markup for medias. Medias are nestable blocks,
635+
so they can be put inside lists and tables, but they cannot be
636+
inlined, for instance in a link..
637+
638+
There are currently three kinds of medias: image, audio, and
639+
video. Each of them can refer to the file either using an asset
640+
reference, or a direct link.
641+
642+
The markup is [{<media>:link}], [{<media>!ref}],
643+
[{{<media>:link}Replacement text}] and [{{<media>:ref}Replacement text}],
644+
where [<media>] is either [image], [video] or [audio].
645+
646+
The replacement text is used for backends that do not support medias
647+
(latex and man), and for when a reference is unresolved. In the case
648+
of an image, it is also used to generate an alternative text.
649+
650+
Images are clickable and links to the image file.
651+
652+
The following source:
653+
654+
{[
655+
renders as: {image:https://picsum.photos/200/300}
656+
]}
657+
658+
renders as: {image:https://picsum.photos/200/300}
632659

633660
{2 Stop Comments}
634661

0 commit comments

Comments
 (0)