File sources and paths

MMX lets you embed media and code from two kinds of sources: a remote URL or a file in your local assets/ folder. This page describes how each is written and what to keep in mind.

Images, videos, audios, inline images and code from files

Every media element accepts the same two source forms:

ElementSyntaxSource goes in
Image!<a target="_blank" href=".././source">alt</a>() of the image
Video!!(source)() of the video
Audio!!!(source)() of the audio
Inline imageSome text <img class="inlineImg" alt="icon" src=".././source">between <img class="inlineImg" alt="icon" src=".././ and ">
Code from file#code(source)() of the directive

The same rule applies to every element: the source is either a URL or a path inside assets/.

URL examples

![A remote image](https://placehold.net/main.svg)
!!(https://example.com/Video.mp4)
!!!(https://example.com/sound.mp3)
#code(https://raw.githubusercontent.com/cp-mario/MMX/refs/heads/main/LICENSE)

Local file examples

![A local image](assets/foto.png)
!!(assets/video.mp4)
!!!(assets/audio.mp3)
Some text <-assets/icon2.svg-> in the middle of a sentence
#code(assets/code/note.txt)

Path rules

Note:

If a referenced file is missing, the generator does not fail. The output HTML will simply contain a broken reference, so always preview your build after adding a new asset.

File-type support

Tab icon and title image

MMX automatically picks up two special files in the assets/ folder if they are present:

If title.* is missing, the sidebar falls back to the title value from config.mcfg.