Exporting my Daybook to Org Mode files


(Jack Baty) #1

Every month I export my Tinderbox “Daybook” entries so that I can print and bind them. I have a pretty good Org Mode setup so I wanted the output to be Org Mode files. From there I could create nice PDFs for printing.

Previously, I used the built-in OPML templates and then converted the output to Org Mode using Pandoc. This was all a bit cumbersome, so I created simple Org Mode export templates, based on the default OPML templates.

Template: Org Mode

#+TITLE: Daybook ^value(attributeEncode($Name))^ 2016
#+DATE: 
#+SETUPFILE: ~/Dropbox/org/_SETUP_DAYBOOK
#+OPTIONS: toc:nil num:nil >:nil ^:nil <:nil H:2
#+STARTUP: overview

^action($HTMLExportExtension=".org")^


^children(/Templates/Org Mode/Org Mode Item item)^

The front matter sets some options and includes my usual LaTeX settings.

Template: Org Mode Item

^if(ChildCount)^*^indent("*",^value($OutlineDepth(parent)-1))^ ^value($Name)^ - ^value(format($StartDate,"M0-D w"))^

^value($Text)
^children(/Templates/Org Mode/Org Mode item)^*^indent("*",^value($OutlineDepth(parent)-1))^
^else^*^indent("*",^value($OutlineDepth(parent)-1))^ ^value($Name)^  - ^value(format($StartDate,"M0-D w"))^

^value($Text)^
^endIf^

This just loops over the notes and outputs org-formatted text.

So, to process my monthly Tinderbox Daybook I do this…

  1. Select the month in Tinderbox
  2. Choose “Export Selected Note”
  3. Open the exported file in Emacs
  4. Hit “CTRL-x CTRL-e l o” to export a PDF
  5. Print.

Much better!

(Here’s the resulting file http://baty.d.pr/lYFt)


Example code for Emacs Org Mode export
(Mark Anderson) #2

For those unfamiliar, Org Mode is an Emacs ‘mode’ describe as “Org: an Emacs Mode for Notes, Planning, and Authoring”. There is extensive documentation.