Tales from the Gryphon

Using org-mode with Ikiwiki

  • Edit this page
  • RecentChanges
  • History
  • Preferences
  • 3 comments
Tales from the Gryphon

Relevant Links

  • New key
  • GPG key
  • PGP key
  • Policy

Categories(89)

  • Books(29)
    • Action(3)
    • Classics(1)
    • Espionage(9)
    • Fantasy(10)
    • Fiction(1)
    • Sci-Fi(5)
  • Debian(8)
    • Official(2)
  • Software(26)
    • Arch(1)
    • Git(4)
    • Packaging(7)
    • Debian(9)
    • IkiWiki(2)
    • Security(3)
  • Movies(6)
  • SysAdmin(1)
  • Spam(10)
  • Travel(2)
  • Miscellaneous(6)

Archives

← 2010
Months
Jan Feb Mar Apr May Jun
Jul Aug Sep Oct Nov Dec
March
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Indices

  • 2004
    • 05
    • 06
    • 07
    • 10
    • 11
  • 2005
    • 03
    • 05
    • 06
  • 2006
    • 01
    • 08
    • 12
  • 2007
    • 01
    • 08
    • 11
    • 12
  • 2008
    • 01
    • 04
    • 05
    • 06
  • 2009
    • 02
    • 03
    • 04
    • 05

My Books:
Widget_logo


Valid XHTML 1.1 Valid CSS! Linux Counter #69681 RSS Valid Ikiwiki hacker emblem

Manoj's hackergotchi
Monday 09 June
2008
Using org-mode with Ikiwiki
[
  • software :: 
  • ikiwiki :: 
]

License: GPL

Using org mode to write ikiwiki posts

I have been much taken by org-mode in Emacs recently. Firstly, this has allowed me to actually effectively implement the tenets of “Getting things done”, which is amazing by itself. I always used to start with great enthusiasm, which rarely lasted longer than a week. Until org-mode. Then this is so amazingly flexible. It has better handling of tables and even a spreadsheet mode than anything I have used — and it has a pretty decent HTML export function. I practically live in org-mode on work days now. I strongly recommend org-mode, from things like agendas, TODO lists, calendars, appointments, articles, and now Ikiwiki posts.

I rarely ever use markdown, apart from blogging using Ikiwiki – and thus, since I blog so infrequently, I rarely ever remember all the syntax. On the other hand, org-mode syntax is now at my finger tips — so I decided it was time to write a Ikiwiki plugin so I can now write my blog posts using syntax I can actually remember. It is still rough around the edges – firstly, this requires emacs23 (or, on Debian, there is the unofficial emacs-snapshot package), secondly, it uses hueristic hacks to prune away the bits of the stand alone HTML page that org-mode creates; all I can say is that it currently works for me, as you can see from this post. How git this is for mainlne inclusion is another matter.

The code is here: org.pm. It can be dropped in to the Ikiwiki plug-in directory, and that’s all you need. With this, Ikiwiki pre-process things in the input file, and then passes it to emacs to htmlize it.

Manoj

Comments

RSS Atom
list it and compare with muse-mode with ikiwiki

Hi!

Perhaps listing it at http://ikiwiki.info/plugins/ would help people find it.

Also, have you seen muse.pm from emacs-muse—Ikiwiki integartion? Technically, it must be similar (it also calls emacs), so perhaps there are some valuable ideas in that code.

Comment by imz [lj.rossia.org] — Friday evening, December 4th, 2009
Emacs' XML-RPC instead of org.pm
Also one could write the plugin (instead of org.pm) completely in Emacs Lisp (using http://www.emacswiki.org/emacs/XmlRpc ) as an “external plugin”, which would be more fun (and also provide a remarkable example of an external plugin for Ikiwiki written in Emacs Lisp).
Comment by imz [lj.rossia.org] — late Friday evening, December 4th, 2009
Just a few things

Thanks for the useful plugin.

I had to comment out the line ‘$ret=~s/(<\/div>\s*$)//s;’ near the end of the file, otherwise one of the

tags doesn’t get closed properly.

My code blocks didn’t get htmlized by default either so I also changed the beginning of the eval line to read “—eval ‘(progn (autoload (quote htmlize-buffer) “/path/to/site-lisp/htmlize.el” nil t)(…

If you have emacs22 or non-standard locations for lisp files it is also worth changing the ‘—batch -l’ part to use ~/.mycustomfile rather than ‘org’. In this file I added:

(add-to-list ‘load-path “~/path/to/site-lisp”) (add-to-list ‘load-path “~/path/to/newer/org-mode”) (require ‘htmlize) ;; colour for code segments (require ‘org) (add-to-list ‘auto-mode-alist ‘(“.org$” . org-mode)) ;; not sure if this is needed

(setq org-export-htmlize-output-type (quote css))

;;; and some of my blogging preferences (setq org-export-headline-levels 3 org-export-with-toc nil org-export-author-info nil org-export-with-section-numbers nil
org-export-skip-text-before-1st-heading nil org-empty-line-terminates-plain-lists t org-export-with-sub-superscripts nil)

Comment by rodyaj [myopenid.com] — early Tuesday morning, January 26th, 2010

Add a comment

Webmaster <webmaster@golden-gryphon.com>
Last commit: late Sunday night, June 9th, 2008

License: GPL

Last edited late Sunday night, June 9th, 2008