Created: February 6, 2019

Last modified: February 5, 2023

Brief foray into ox-slimhtml

Intro

When I began creating this website I was overwhelmed by the complexity of ox-html.el which is responsible for exporting org files to HTML. I came across ox-slimhtml.el which is simpler and easier to understand the mechanics of what is happening upon export.1

Code

For posterity here’s how my org-publish-project-alist was shaping up under the ox-slimhtml exporter:

<link href='/styles.css' rel='stylesheet' type='text/css'>
:base-extension "org"
:publishing-function ox-slimhtml-publish-to-html
:html-doctype "html5"
:html-head-extra "
<<html-header>>
"
:author "Akira Kyle"
:email "akira@akirakyle.com"
:recursive t
:base-extension "svg\\|pdf"
:publishing-function org-publish-attachment
:recursive t
("pages"
 :base-directory "~/Documents/website/pages/"
 :publishing-directory "~/Documents/www/"
 <<publish-common-html-props>>
 )
("blog"
 :base-directory "~/Documents/website/blog/"
 :publishing-directory "~/Documents/www/blog/"
 <<publish-common-html-props>>

 :auto-sitemap t
 :sitemap-filename "blog.org"
 :sitemap-title "Akira Kyle's Blog"
 )
("pages-resources"
 :base-directory "~/Documents/website/pages/"
 :publishing-directory "~/Documents/www/"
 <<publish-common-resource-props>>
)
("blog-resources"
 :base-directory "~/Documents/website/blog/"
 :publishing-directory "~/Documents/www/blog/"
 <<publish-common-resource-props>>
 )
("website"
 :components ("pages" "pages-resources" "blog" "blog-resources"))
(setq org-html-htmlize-output-type 'css)

(setq org-publish-project-alist `(
<<org-publish-components>>
))

(org-publish "website" t)

Conclusions

I abandoned this as it didn’t have the ability to do syntax highlighting of code blocks through htmlize.el which I wanted. I may end up returting to ox-slimhtml as the starting point for my own custom org HTML exporter some day when I feel I need even more custom control. In any case looking over the source of ox-slimhtml is a gentler intro to understanding the source of ox-html and so I was glad to know of it’s existence.

Footnotes:

1

compare ox-html.el at 3842 lines of code vs ox-slimhtml.el at only 592 lines of code