Skip to content

Commit 6c4e928

Browse files
committed
Media: add documentation
1 parent 10b4f32 commit 6c4e928

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

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

632659
{2 Stop Comments}
633660

0 commit comments

Comments
 (0)