Skip to content

fjavieralba/rst_gist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

rst_gist

This small piece of code is an rst directive that allows you to embed Github Gist snippets in your rst docs. This can be used in Pelican blog generator since it uses rst as it source for generating pages.

Usage

.. gist:: <GIST_ID> <FILENAME>

To know your GIST_ID and FILENAME simply go to your gist in github and click on the "embed" option. The HTML you see contains your GIST_ID and FILENAME: <script src="https://gist.github.com/<GIST_ID>.js?file=<FILENAME>"></script>

Install on Pelican

If you want to easily embed gists in your pelican blog, all you have to do is:

  • Download the gistdirective.py file

  • Download the pelican code

  • Add gistdirective.py to the pelican/pelican folder

  • Modify the file pelican/pelican/readers.py and add the following import:

    from pelican import gistdirective
    
  • Install pelican from source:

    $ cd <pelican_home>
    $ python setup.py install
    

And voilà, you can use gist directive to embed your snippets.

About

rst directive to embed github gist snippets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages