Abstract
This demonstration compiles all available media in the official assets/ directory of the MarkCharm project, including audio clips, videos, and an extensive collection of images (crests, classical illustrations, and diagrams).
The goal is to ensure robust rendering of multimedia elements.
MarkCharm natively supports embedding audio and video resources with playback controls in the final HTML document. Instead of relying on raw HTML tags, authors can use intuitive, declarative fenced blocks to define media assets. The compiler handles the complexity of inserting the appropriate <audio> and <video> tags, applying CSS classes, and ensuring accessibility through alternative texts (alt).
Furthermore, the system extracts rich metadata from the YAML frontmatter, such as title, source, and note, rendering them automatically as accessible captions and semantic footers. This ensures that multimedia elements remain fully compliant with academic and governmental standards (like ABNT or SISP), which strictly require proper source attribution for every non-textual asset.
The following section demonstrates the integration of a local audio clip. Observe how the metadata provided in the block (such as the source and alternative text) is transformed into a clean, standardized caption block.
MarkCharm also provides native support for video embeddings. A standout feature showcased here is the Media Fragments URI specification (#t=start,end).
By simply appending #t=05,15 to the video's URL, MarkCharm instructs the browser to automatically start playback at the 5-second mark and pause at the 15-second mark. This is exceptionally useful for highlighting specific moments in long recordings or tutorials without the need to manually edit or crop the video files.
The MarkCharm compiler includes an intelligent image pipeline that embeds local images directly into the output document using Base64 encoding. This guarantees that the final HTML file is completely self-contained and can be distributed offline without broken links.
The system supports a wide range of formats, from traditional raster images (PNG, JPG, BMP) to vector graphics (SVG). Authors can also control the sizing of the image using the width property, allowing for flexible layout adjustments directly from the document source.
Official documents frequently require the inclusion of national, municipal, or institutional crests and coats of arms. Below, we showcase how high-resolution images of official symbols (like the Crest of Santa Maria da Feira, the Coat of Arms of the Royal Society, and the Historical Flag of Portugal) are embedded. Notice how each image is paired with a resized (50%) counterpart, demonstrating MarkCharm's robust layout engine which handles dynamic scaling without loss of aspect ratio.
As another example of heraldic embedding, the Coat of Arms of the Royal Society is shown below. This image contains intricate typography and fine details that must be preserved when compiled into the final document.
Flags and national symbols often require precise color reproduction. The Historical Flag of Portugal (1830–1910) is embedded here to demonstrate accurate color rendering within the MarkCharm pipeline.
For academic and historical publications, embedding classical illustrations is a common requirement. The examples below, featuring Raphael's famous "School of Athens" in the Vatican and classic "Alice in Wonderland" illustrations, demonstrate MarkCharm's capacity to maintain the visual fidelity of artistic and intricate images. The compiler ensures that these high-density raster images are properly packaged and rendered responsively across different viewport sizes.
Another classic example is John Tenniel's original illustrations for Alice's Adventures in Wonderland. These black-and-white engravings require high contrast and sharp line reproduction, which the Base64 embedding effortlessly preserves.
Here is another instance of the same classical art style, showcasing consistency across multiple image blocks:
Scientific literature demands precise rendering of complex data visualizations. Whether it is an intricate Periodic Table of Elements or a complex system diagram, MarkCharm handles these with pixel-perfect accuracy. Furthermore, MarkCharm provides full support for SVG (Scalable Vector Graphics) files, as demonstrated by the pie chart below. SVGs are particularly advantageous for charts and graphs, as they offer infinite scalability and crisp resolution on any device or printed medium.
For software documentation, architecture and system diagrams (like the generic flowchart below) are critical. The compiler ensures that technical diagrams remain readable by applying appropriate CSS constraints that prevent horizontal overflow.
When including media (images, audio, video) via YAML frontmatter, always use the datasource: key instead of datasource:. The datasource: key is a special MarkCharm directive that auto-loads the target file's raw content into the block's body (useful for injecting code snippets or CSV data). If you use datasource: on an SVG or binary image, the compiler will dump the raw XML/binary text directly into the page as a <pre> block!
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">