Blogging with emacs, org-mode and wordpress

I want to be able to seemlessly publish from emacs to wordpress. I’d like to create or update posts as an org-mode entry and then to publish them on this blog.

To achieve this I’ll need org2blog/wp, a lisp package that can export org entries to wordpress, org2blog depends on xml-rpc-el.

So first step is to get the software from the code repos:

$ cd ~/.emacs.d/
$ bzr branch lp:xml-rpc-el
$ git clone https://github.com/punchagan/org2blog.git

Then add some lines in ~/.emacs.d/init.el:

 1:  (add-to-list 'load-path "~/.emacs.d/xml-rpc-el")
 2:  (add-to-list 'load-path "~/.emacs.d/org2blog")
 3:  (require 'org2blog)
 4:  
 5:  (setq org2blog/wp-blog-alist
 6:    '(("42kettles"
 7:      :url "http://42kettles.net/xmlrpc.php"
 8:      :username "xxxx"   
 9:      :tags-as-categories nil)))
10:  
11:  (setq org2blog/wp-track-posts nil)

Then try to login just to be sure that everything is working smoothly:

M-x org2blog/wp-login

If it doesn’t work, check that xml-rpc is enabled in wordpress’s writing settings.

Now to post or update an article all I have to do is to go to the org-mode entry I want to publish and do:

M-x org2blog/wp-post-subtree

And that’s it !

Small tweaks I need to do:

  • by default the entry is posted as a draft, I’ve yet to find how to publish it.
  • define settings for syntax highlighting
  • define settings for categories/tags and org file structure (test tag inheritance).

I’m all for ATOM so as wordpress support it, I may give a try to org2blog/atom.

This entry was posted in emacs. Bookmark the permalink.

5 Responses to Blogging with emacs, org-mode and wordpress

  1. Pingback: Setting up blogging from orgmode to http://lejyby.wordpress.com | Le JyBy

  2. Pingback: Moving to WordPress for LaTeX support. | Le JyBy

  3. Thanks for your instructions, they were very usefull!

    In return, maybe I can help you back: the function “org2blog/wp-post-buffer-and-publish” should solve your issue “by default the entry is posted as a draft, I’ve yet to find how to publish it.”.

  4. Pingback: Blogging with Emacs Org-Mode « Mark Stoehr's Blog

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>