Render video tags in python markdown for images that are video
Project description
pymarkdown-video
Extension for python-markdown, that will convert markdown picture that are vide
file into the HTML5 video
tag instead of the img
tag.
Example
![Big Buck Bunny](http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4 "Big Buck Bunny video")
will be rendered as
<p>
<video alt="Big Buck Bunny" controls="controls" title="Vidéo de Big Buck Bunny">
Your browser does not handle the video <a href="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4">http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4</a>
<source src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" type="video/mp4"></source>
</video>
</p>
Usage
pip install pymarkdown-video
from markdown import Markdown
text = '![Big Buck Bunny](http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4 "Big Buck Bunny video")'
md = Markdown(extensions=['pymarkdown-video'])
print(md.convert(text))
You can also use it with MkDocs.
After installing the package with pip, in your mkdocs.yml
, add:
markdown_extensions:
- pymarkdown-video
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pymarkdown-video-1.0.0.tar.gz
(2.3 kB
view hashes)
Built Distribution
Close
Hashes for pymarkdown_video-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08859fd6d15d2017a4a7d7fdf854c8c04131d35c16158f876d8db32bdc541361 |
|
MD5 | 6d65634d065f621755cb9258cda0db3d |
|
BLAKE2b-256 | 63dfcdc29989a875a739372f971db7c49aca273691abf89586cca3ae6034f6b2 |