Skip to main content

Video tag generator markdown extension

Project description

Vidify - convert img tags to html5 video tags

Vidify is a plugin for Python's Markdown that allows you to embed html5 video into your document. It's inteneded for Python 3.6 + but is probably back-compatible with 2.7.

Vidifiy works by detecting <img> tags pointing at a file with an extension of .webm, .mp4, or .ogg and replacing them with <video> tags.

Installing

Simply install from PyPi:

pip install markdown-vidify

Usage

Simply import the package and then pass it to the extensions parameter of markdown!

import markdown
import markdown_vidify

# ...

ouptut = markdown.markdown(input, extensions=[
    markdown_vidify.VidifyExtension(
        autoplay=False,
        controls=True,
        loop=False,
        mute=False,
    )
])

Options

All default to false:

  • autoplay - Autoplay the video once page is loaded
  • controls - Display player controls below the video
  • loop - Loop the video
  • muted - Video is muted by default

Extra Hints!

Consider using the Attribute List plugin that comes with markdown to set the html5 poster attribute. This will be an image that displays in-place of your video while it is downloading or until the user hits the play button!

![alt](/path/to/video.webm){: poster="/path/to/image.png"}

Weird Caveat

Since html5 video doesn't have an alt-text, the body of the [] is entirely ignored. Other plugins may still use it however. I am aware of how -janky- this is. I considered using it for the poster tag but that still feels janky and it would also interfere with other markdown plugins. If you feel you haev a good usgesstion feel free to post it as an issue.

Boring Stuff

vidify was written by Jason Hamilton-Smith <hs.jason@gmail.com>, my website is zchfvy.com.

This project is licensed under the GPL v3.0 license. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

markdown-vidify-0.1.2.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

markdown_vidify-0.1.2-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file markdown-vidify-0.1.2.tar.gz.

File metadata

  • Download URL: markdown-vidify-0.1.2.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9

File hashes

Hashes for markdown-vidify-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d01003ab00b5332a198c168db4c8c912eb3e1bc5996f58de8480def48a3385f8
MD5 3fcbbe4a139c63f572e69018ff8a77e9
BLAKE2b-256 230fe268243909510151bea05691f286dc92f738e219667ef6433fb09e3cf08b

See more details on using hashes here.

File details

Details for the file markdown_vidify-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: markdown_vidify-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9

File hashes

Hashes for markdown_vidify-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 493407fb81fda84bc33192bbd06bf531fbd095bf0d6f6c8c1d863dab8864e065
MD5 7aade9b6410c4d315a6d89cb8a4c7986
BLAKE2b-256 adce2c33ea2252e13e093b1fd9b45670269d13c8956a6ac04dcd91604e440621

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page