Sunday, October 27, 2013

Blogging from emacs org-mode


Blogging

README

Atom blogging via BPE

BPE Installation

DONE Install Google Client commandline/API tools

On Ubuntu try

sudo apt-get install googlecl

DONE Configure package

For me this looked like

cd ~src
bzunzip2 g-client.tar.bz2
tar -xvf g-client.tar
cd src/g-client
make config
make

DONE install BPE form packages

BPE configuraiton code

; set up emacs interface to googlecl
(add-to-list 'load-path "~/src/g-client" t)
(load-library "g")

; setup bpe
(require 'bpe)
(require 'htmlize nil 'noerror) ; to fontify source code block on your blog.
(setq bpe:account "yourUsername@gmail.com")
(setq bpe:blog-name "yourBlogname")
(define-key org-mode-map (kbd "C-c C-p") 'bpe:post-article)
(define-key org-mode-map (kbd "C-c C-i") 'bpe:insert-template)
;; For Japanese, default is $LANG environment variable.
;(setq bpe:lang "ja_JP.UTF-8")

BPE posting

  • open an .org file
  • C-c C-i to insert a template
  • write the post
  • C-c C-p to posts
  • posts as draft
  • bug: have to insert a " tagname" after "#+TAG:" in template.

Wordpress blogging

Wordpress configuration code

(setq load-path (cons "~/.emacs.d/elpa/org2blog-20130704.908/" load-path))
(require 'org2blog-autoloads)

(setq org2blog/wp-blog-alist
'(("wordpress"
:url "http://yourUsername.wordpress.com/xmlrpc.php"
:username "yourUsername"
:default-title "Goodbye World"
:default-categories ("org2blog" "emacs")
:tags-as-categories nil)
("food8forthought"
:url "http://yourUsername.wordpress.com/xmlrpc.php"
:username "yourUsername"
:default-title "Set a title next time"
:default-categories ("word" "vi")
:tags-as-categories nil)
))

(message "blogging.org finished.")

No comments:

Post a Comment