mkdocs-video

1.5.0 · active · verified Thu Apr 16

mkdocs-video is a Python plugin for MkDocs that simplifies embedding videos into documentation pages using a straightforward Markdown syntax. The current version is 1.5.0, which features a rewritten HTML parsing mechanism using `lxml.html` for more granular configuration with Python-Markdown's Attribute Lists extension. The project maintains an active, though irregular, release cadence.

Common errors

Warnings

Install

Imports

Quickstart

To quickly get started, install the package and then enable the `mkdocs-video` plugin in your `mkdocs.yml` file under the `plugins` section. You can then embed videos in your Markdown files using a simple image-like syntax with `![type:video](path/to/video.mp4)`. For fine-grained control, especially with version 1.5.0 and newer, enable the `attr_list` Markdown extension and use attribute lists in your Markdown.

# mkdocs.yml
site_name: My Docs with Videos
plugins:
  - mkdocs-video: # Minimal configuration
      is_video: True # Optional: Forces <video> tag over <iframe>

# docs/index.md
# Embed a local video
![type:video](videos/my_local_video.mp4)

# Embed a YouTube video
![type:video](https://www.youtube.com/watch?v=VIDEO_ID)

# Embed a video with specific attributes using Attribute Lists (requires markdown_extensions:
#   - attr_list in mkdocs.yml, available since mkdocs-video v1.5.0)
![type:video](videos/another_video.mp4){: autoplay loop muted style='width: 80%;'}

view raw JSON →