If you create an exercise, you may want to add your own static content such as images in the exercise description (descr.html
or descr.md
).
Learn-OCaml provides this feature, so that you can either add images hosted in an external domain, or images statically served by the Learn-OCaml server itself (which can be handy for summative exams, for example, when remote resources are blocked).
In order to include OCaml.png
in an exercise called demo
, you just need to:
<repo>/exercices/demo/subdirectory
. (The name of the subdirectory
is free.)OCaml.png
in there.<repo>/exercises/demo/descr.html
(resp. <repo>/exercises/demo/descr.md
), use the following syntax:<img src="/static/demo/subdirectory/OCaml.png" alt="fallback text">
(resp. 
).Note that we can’t use relative URLs, hence the leading /
.
If you want to fix the width (or height) of an image in descr.html
or descr.md
, you can use the usual HTML syntax:
<img src="/static/demo/subdirectory/OCaml.png" alt="fallback text" width="400px">