Images & Media
Basic Images
Use standard Markdown syntax to embed images. We recommend storing images in your assets/images/ folder.

Image Styling
You can add classes to images using the attribute syntax { .class } after the image.
Sizing
{ .size-small }
{ .size-medium }
{ .size-large }
Alignment
{ .align-center }
{ .align-right }
Shadows & Borders
{ .with-shadow .with-border }

Responsive Images
All images in docmd are responsive by default, automatically scaling to fit their container.
Image Captions
Add captions to your images using the figure syntax:
<figure>
<img src="/path/to/image.jpg" alt="Description of image">
<figcaption>This is the caption for the image</figcaption>
</figure>
Image Galleries and Lightbox
docmd includes built-in lightbox functionality for image galleries. When users click on an image in a gallery, it opens in a full-screen lightbox view.
Image Galleries
You can group multiple images into a responsive grid using the image-gallery class, use figcaption for image captioning. This requires raw HTML wrapping.
<div class="image-gallery">
<figure>
<img src="../../assets/img1.jpg" alt="View 1">
<figcaption>Dashboard View</figcaption>
</figure>
<figure>
<img src="../../assets/img2.jpg" alt="View 2">
<figcaption>Settings View</figcaption>
</figure>
</div>
Lightbox (Zoom)
If mainScripts is enabled (default), clicking any image in a gallery or any image with the .lightbox class will open a full-screen zoom view.
{ .lightbox }
Image Optimization Best Practices
For optimal performance:
Use appropriate formats:
- JPEG for photographs
- PNG for images with transparency
- SVG for icons and logos
- WebP for better compression (with fallbacks)
Optimize file sizes:
- Compress images before adding them to your documentation
- Consider using tools like ImageOptim, TinyPNG, or Squoosh
Provide responsive images:
- Use the HTML
<picture>element for advanced responsive image scenarios
- Use the HTML
Specify dimensions:
- Always include width and height attributes to prevent layout shifts