Skip to main content

Easily embed GitHub Gists in your Pelican articles.

Project description

Pelican Gist Tag is a library to make it easy to GitHub Gists in your Pelican blogs.


To install pelican-gist, simply:

$ pip install pelican-gist

Then add a bit of code to your blog configuration:

    # ...
    # ...


In your articles, just add lines to your posts that look like:


This will tell the plugin to insert gist id 3254906 and choose the file into your post. The resulting HTML will look like:

<div class="gist">
    <script src=''></script>
        <pre><code>#!/bin/bash ...</code></pre>

If your gist has only a single file, you can also specify the gist like so:


Notice it is using the id only. The resulting HTML will look like:

<div class="gist">
    <script src=''></script>
        <pre><code>#!/bin/bash ...</code></pre>

If a file type is specified, uses pygment to highlight the noscript version of the code:


There is also support for private gists where they have the gist id that looks like e34db4c532a6cfa1f711.


GIST_CACHE_ENABLED - Specifies whether to cache the gist on disk or not. Default is True. (Optional) GIST_PYGMENTS_STYLE - Style used by pygments for syntax highlighting. Possible values are the strings from pygments.styles.get_all_styles(). Default is 'default'. (Optional) GIST_PYGMENTS_LINENUM - Defines if pygments should add line numbers to the rendered HTML. Default is False. (Optional)


Install the necessary requirements with pip install -r requirements.txt. Once those are installed, you can run the tests with: py.test. So the whole workflow looks like:

$ pip install -r requrements.txt
Successfully installed pytest requests mock py
Cleaning up...
$ py.test
======================== test session starts =========================
platform darwin -- Python 2.7.6 -- pytest-2.5.1
collected 5 items

pelican_gist/ .....

====================== 5 passed in 0.11 seconds ======================


See contributors on GitHub.


  • 0.3.4 - Fix regex to support filetype (credit [@andrlik](
  • 0.3.3 - Support gists with UTF-8 characters
  • 0.3.2 - Added universal wheel support
  • 0.3.1 - Fixed an issue with Python 3 and fetching gist content
  • 0.3.0 - Added Python 3 support


Uses the MIT license.

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

pelican-gist-0.3.4.tar.gz (6.2 kB view hashes)

Uploaded source

Built Distribution

pelican_gist-0.3.4-py2.py3-none-any.whl (8.3 kB view hashes)

Uploaded 2 7

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page