org-protocol-jekyll

https://github.com/vonavi/org-protocol-jekyll.git

git clone 'git://github.com/vonavi/org-protocol-jekyll.git'
2

Description

Jekyll is a blog-aware, static site generator in Ruby. The management of Jekyll's site by creating and editing files in the local working directory looks pretty easy, unless the access to a certain source file is required. The use of Emacs and org-protocol-jekyll solves this issue for me. org-protocol-jekyll relies on org-protocol which scans the list of filenames passed to the Emacs server for org-protocol:/sub-protocol:/ and triggers actions associated with sub-protocol. org-protocol-jekyll realizes the jekyll sub-protocol to open sources of a site built with Jekyll for editing. org-protocol-jekyll has been successfully tested with Jekyll 1+.

Usage

Create a bookmark in browser with the following “Location”:

javascript:location.href='org-protocol://jekyll://'+
  encodeURIComponent(location.href)

You need Emacs to run in daemon mode or start a server: M-x server-start. Then point out Emacsclient as the application to open org-protocol links with. In Linux, create emacsclient.desktop in directory /usr/share/applications/ (for all users) or ~/.local/share/applications/ (for the current user), and put this stuff there:

[Desktop Entry]
Name=Emacs Client
Exec=emacsclient %u
Icon=emacs
Type=Application
Terminal=false
Categories=System;
MimeType=x-scheme-handler/org-protocol;

Add the following line in the Emacs initialization file:

(require 'org-protocol-jekyll)

Customizable variable org-protocol-jekyll-alist contains the list of Jekyll's sites, for instance,

(setq org-protocol-jekyll-alist
      '(("Jekyll's awesome website."
         :base-url "http://jekyllrb.com"
         :permalink "pretty"
         :working-directory "/home/user/jekyll"
         :working-suffix (".md", ".markdown"))
        ("Local Jekyll's site."
         :base-url "http://localhost:4000"
         :permalink "pretty"
         :working-directory "/home/user/jekyll"
         :working-suffix (".md", ".markdown"))))

where

Now visit any page of Jekyll's site and click the bookmark created for org-protocol-jekyll. See in Emacs the corresponding source file ready for editing!

Installation

ELPA affords the easy way to install org-protocol-jekyll for Emacs from MELPA or Marmalade Package Archive.