Links and images
Links
See link::https://scholartools.fr[ScholarTools] for more tools.HTML produced
See <a href="https://scholartools.fr">ScholarTools</a> for more tools.The URL comes right after link::, the label between brackets. The label can hold bold, italic
or inline code; without a label, the link shows its URL:
link::https://example.org
or link::https://example.org[a **bold** label]HTML produced
<a href="https://example.org">https://example.org</a>
or <a href="https://example.org">a <strong>bold</strong> label</a>A class goes in parentheses after the URL: link::page.html(.nav)[Back to home]. A link to a
part of the page is link::#exercise[...] (see Classes and ids).
Images
img::https://scholartools.fr/favicon.svg[width:64px;]HTML produced
<img style="width:64px;" src="https://scholartools.fr/favicon.svg" alt="https://scholartools.fr/favicon.svg">A relative path, as img::assets/photo.jpg, starts from the page. The alt text, read by screen
readers and shown when the image is missing, is by default the path of the image. Give a better
one as an attribute:
img::https://scholartools.fr/favicon.svg[width:64px;]{alt="The logo of ScholarTools"}HTML produced
<img style="width:64px;" alt="The logo of ScholarTools" src="https://scholartools.fr/favicon.svg">An image as a link
Put the image in the label of the link: a click on the image opens the page.
link::https://scholartools.fr[img::https://scholartools.fr/favicon.svg[width:48px;]{alt="ScholarTools"}]HTML produced
<a href="https://scholartools.fr"><img style="width:48px;" alt="ScholarTools" src="https://scholartools.fr/favicon.svg"></a>Videos
video:: shows a video without its buttons: add the attribute controls to play and pause it.
video::https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4[width:320px;]{controls}HTML produced
<video controls style="width:320px;">
<source src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4" type="video/mp4">
Cannot play video https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4
</video>A poster, the image shown before the video starts, is an attribute too:
video::clip.mp4{controls poster="clip.jpg"}. LHTML does not look for one: write it.
videoplay plays by itself, in a loop and without sound: the form for an animation in a slide.
videoplay::https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4[width:320px;]HTML produced
<video autoplay loop muted playsinline style="width:320px;">
<source src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4" type="video/mp4">
Cannot play video https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4
</video>Not every browser reads every format. lhtml-site can convert the videos: set
cache_video_directory: in configure.yaml, and the build makes the variants of the videos in
the assets/ of each page, each one added as a <source> of its video. lhtml-site doctor says
whether the tools it needs are installed.
Next: Code. All the rules: Syntax reference.