org-export-as-blosxom-story Programming Notes

I like to use GNU Emacs's org mode for simply formatted text files. However, the vanilla configuration of the Blosxom blogging engine renders everything after the first line title as one run-together paragraph. I have tried adapting more than one Blosxom formatting plugin to make org files minimally attractive, but without success. I have decided to take another approach by exploiting the HTML generation capability already in org mode.

Purpose

Convert org files to Blosxom story format.

Advantages

Disadvantages

Existing functions

org-export-as-htmlExport and overwrite <filename>.html.
Master function for org-to-HTML export.
org-export-as-html-to-bufferExport to buffer. Calls org-export-as-html.
org-export-region-as-htmlExport region to buffer.
Prefix arg. causes org header and
footer to be omitted.
Calls. org-export-as-html.
org-replace-region-by-htmlEUREKA!
HTMLizes ALL text in region without header
or footer.
Perfect export for Blosxom if region
set from second line of file (to exclude
title) to end of file.

Org export functions ignore text before first heading unless variable org-export-skip-text-before-1st-heading is nil. However, text before first heading is exported as-is without HTML tags inserted.

(org-replace-region-by-html has problems on Zaurus. Need to update org mode software?)

Org file format

  1. First line is story title in plain text.
  2. Second and succeeding lines are story body with org mode markup inserted as desired.

Blosxom story format

  1. First line is story title in plain text.
  2. Second and succeeding lines are story body, which may optoonally be formatted with HTML tags.

Tricks

Problem: When org export doesn't ignore text before first heading, it considers it to be part of the document header, and therefore omits it when exporting "body-only".

Solution: Insert a null org heading "* " on line after story title during export processing. This will generate a "body" division containing all text between the title and first actual heading with an empty heading that won't be displayed. (Will not need to process "initial text" as such since all text before first explicit hading will be under dummy preamble heading.)

Problem: org-replace-region-by-html converts <, > to &lt;, &gt;, so defeats more plugin.

Solution: Lines starting with "#+HTML:" are exported verbatim without conversion.