Skip to content

Extension for python-markdown that handle HTML5 video when used as image in markdown

License

Notifications You must be signed in to change notification settings

orobardet/pymarkdown-video

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Extension for python-markdown that handle HTML5 video when used as image in markdown

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages