Rich media in Markdown
Enhance your documentation with rich media content including images, videos, PDFs, mathematical equations, and diagrams.
Images
You can use locally stored images or URLs to include images in your Markdown pages. Use either Markdown syntax or the <img> HTML tag to insert the image. Don’t use the <embed> element, as it has inconsistent browser support.
Image paths
You can reference images using paths relative to the page’s location (using ./ or ../) or relative to the fern folder root (using /). For example, an image at fern/assets/images/logo.png can be referenced from any page as /assets/images/logo.png.
Markdown
HTML
Common image attributes:
For more details about the HTML image element and its attributes, see the MDN documentation on the img element.
PDFs
Embed PDFs using the <iframe> element. Don’t use the <embed> element, as it has inconsistent browser support.
Rendered video
HTML
Videos
Local videos
You can embed videos in your documentation using the HTML <video> tag. This gives you control over video playback settings like autoplay, looping, and muting. Don’t use the <embed> element, as it has inconsistent browser support.
.mdx files use JSX syntax, not pure HTML. Attributes for HTML elements like <video> and <iframe> that are embedded in .mdx pages must be written in camelCase rather than lowercase. For example, use autoPlay instead of autoplay.
Rendered video
HTML
You can also wrap the video in a container div for additional styling:
Common video attributes:
For more details about the HTML video element and its attributes, see the MDN documentation on the video element.
Embed YouTube or Loom videos
You can embed videos from YouTube, Loom, Vimeo, and other streaming platforms using an <iframe> element.
.mdx files use JSX syntax, not pure HTML. Attributes for HTML elements like <video> and <iframe> that are embedded in .mdx pages must be written in camelCase rather than lowercase. For example, use autoPlay instead of autoplay.
Rendered Loom video
Loom video syntax
See an example of how it renders on the corresponding docs page from the ElevenLabs documentation.
LaTeX
Fern supports LaTeX math equations. To use LaTeX, wrap your inline math equations in $. For example, $(x^2 + y^2 = z^2)$ will render .
For display math equations, wrap the equation in $$. For example:
Diagrams
Fern supports creating diagrams within your Markdown using Mermaid. Mermaid offers a variety of diagrams, including flowcharts, entity-relationship models, and Gantt charts. To include a Mermaid diagram in your Markdown file, create a codeblock marked with mermaid.