Markdown extension to allow media embedding using the oEmbed standard.
Find a file
Sami Turcotte e2e29489d7 Allow arbitrary oEmbed endpoints
Before this change, only three hardcoded oEmbed endpoints were available
for users of the extension; youtube, flickr and vimeo. In the
configuration, it was only possible to pass a subset of those 3 oEmbed
endpoints. It was done by passing the names of the allowed endpoints.

With this change, the API has changed. The allowed_endpoints kwarg now
expects to be passed a list of OEmbedEndpoint objects (as opposed to
names). This means the responsibility of creating OEmbedEndpoint objects
has been shifted to the user of the extension. If the allowed_endpoints
kwarg is omitted, the default oEmbed endpoints used will be the same as
before; youtube, flickr and vimeo.

The motivation is to allow arbitrary oEmbed endpoints, without
necessitating anyone to maintain the list of all possible oEmbed
endpoints out there.
2015-04-21 05:18:42 -04:00
mdx_oembed Allow arbitrary oEmbed endpoints 2015-04-21 05:18:42 -04:00
.gitignore updated readme and setup.py 2012-11-13 15:37:35 -06:00
LICENSE added license and manifest template, bumped alpha version 2012-11-13 16:55:47 -06:00
MANIFEST.in added license and manifest template, bumped alpha version 2012-11-13 16:55:47 -06:00
README.markdown updated setup.py and added manifest for readme and license file 2012-11-13 16:33:36 -06:00
setup.py Version bump 2015-04-20 00:44:21 -04:00
tests.py Fixing tests, still needs work on auto protocol 2014-07-22 17:12:30 -05:00

Python Markdown oEmbed

Markdown extension to allow media embedding using the oEmbed standard.

Installation

pip install python-markdown-oembed

Usage

>>> import markdown
>>> md = markdown.Markdown(extensions=['oembed'])
>>> md.convert('![video](http://www.youtube.com/watch?v=zqnh_YJBvOI)')
u'<iframe width="459" height="344" src="http://www.youtube.com/embed/zqnh_YJBvOI?fs=1&feature=oembed" frameborder="0" allowfullscreen></iframe>'

License

A Public Domain work. Do as you wish.