GithubHelp home page GithubHelp logo

skarred / embedly_cards Goto Github PK

View Code? Open in Web Editor NEW

This project forked from josh146/embedly_cards

0.0 2.0 0.0 228 KB

Pelican plugin for embedding external content using Embed.ly Cards

License: Other

Python 100.00%

embedly_cards's Introduction

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()]

Important

If creating the MD_EXTENSIONS variable for the first time, ensure that the Pelican 'codehilite(css_class=highlight)' and 'extra' markdown extensions are included in the list.

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)

embedly_cards's People

Contributors

josh146 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.