Skip to main content

Pelican plugin for embedding external content using Embed.ly Cards

Project description

Embedly-Cards

Embedly-cards is a Pelican plugin providing restucturedText directives to allow easy embedding of external content using Embed.ly Cards.

ReST and markdown live examples can also be viewed from a Pelican-built website.

Features

Embed content within a page or blog post easily, simply by specifying the URL of the target page. Content is automatically recognised, extracted, and formatted as a ‘card’; this may contain a short article preview, embedded video, picture etc.

To preview a card, they can be generated online using Embed.ly. Almost any site is compatible, including YouTube, Flickr, Google+, Maps, Wordpress etc.

Installation

Embedly-cards can be installed using pip

$ pip install embedly-cards

or manually from the source code

$ python setup.py install

Once installed, simply add it to your pelicanconf.py configuration file:

PLUGINS = [
    # ...
    'embedly_cards'
]

If you are planning on embedding content in markdown .md files, you must also add it to the MD_EXTENSIONS options, like so:

from embedly_cards import EmbedlyCardExtension
MD_EXTENSIONS = ['codehilite(css_class=highlight)',
                 'extra',
                 # ...
                 EmbedlyCardExtension()]

Usage

For example, to embed a YouTube video in ReStructuredText:

.. embedly-card:: https://www.youtube.com/watch?v=ZlfIVEy_YOA

or in markdown:

[!embedlycard](https://www.youtube.com/watch?v=ZlfIVEy_YOA)

Or to embed an article/webpage in ReStructuredText:

.. embedly-card:: http://physics.stackexchange.com/questions/5265/cooling-a-cup-of-coffee-with-help-of-a-spoon

or in markdown:

[!embedlycard](http://physics.stackexchange.com/questions/5265/cooling-a-cup-of-coffee-with-help-of-a-spoon)

Options

The card-chrome (ReST) or chrome (markdown) option, if provided, specifies whether or not to preserve the border around the card. By default, the border will be removed automatically if Embed.ly supports it; however to force the border to remain, you may pass :card-chrome: 1 (ReST),

.. embedly-card:: https://www.youtube.com/watch?v=ZlfIVEy_YOA
    :card-chrome: 1

or chrome=1 (markdown):

[!embedlycard?chrome=1](https://www.youtube.com/watch?v=ZlfIVEy_YOA)

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

embedly_cards-0.2.0.tar.gz (16.6 kB view hashes)

Uploaded Source

Built Distribution

embedly_cards-0.2.0-py2-none-any.whl (7.0 kB view hashes)

Uploaded Python 2

Supported by

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