Huy Minh Ha

Software development, Tech and other stuff

Thu 11 September 2014

Embed git file to pelican

Posted by Ha.Minh in Blog   

Writing articles in github pages is nice, because you have github repository with all the nice features for document management, however sometimes it's not where I want my articles to reside. For instance, I want the articles about git to be in a separate git repository.

I have several solutions for this problem:

  • I could duplicate the article. But I won't do this.
  • I could store the articles as gist like this:

But I can't store a lot of related things in gist because that's the role of a real git repo.

  • I could store the articles in the normal git repo, and embed it into the article in github page. I chose this approach for long articles. Like this:

There's already a nice tool to do this: gist-it. Using it is really simple, just clone the repo and deploy it to an AppEngine instance. The downside of this is it does not generate html code for Markdown.

  • The best solution for me is to use a plugin for embedding git file into pelican like this:

First level title

Notes from link .

Second level title

Quote some code with correct syntax highlight

for i in [0, 1, 2, 3, 4, 5]:
    print i**2

for i in range(6):
    print i**2

Third level title

for i in xrange(6):
    print i**2
  • First item
  • Second item
Brought to you by pelican_git. view original sample.md


    
 
 

Comments