emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to export to the simplest possible HTML?


From: Marcin Borkowski
Subject: How to export to the simplest possible HTML?
Date: Tue, 30 May 2023 05:47:00 +0200
User-agent: mu4e 1.1.0; emacs 30.0.50

Hello everyone,

I'd like to export an Org buffer (or portion of it) to the simplest HTML
possible, prgrammatically.  For example, I only want the body, I don't
want any generated IDs, and I don't want the ToC.  I tried this:

(org-html-export-as-html nil nil nil t '(org-export-with-toc nil))

but the ToC still appears in the output.  Also, I'd prefer to do it
a bit "less interactively" - for example, setting the current buffer to
the one with export results is unnecessary for me, since I'm going to
call my exporting function in a loop over many elements.  I tried

(org-export-with-backend 'html (org-element-at-point (point)))

but it errored out:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  org-html-headline((headline (:raw-value ...)) ...)
  org-export-with-backend(html (headline (:raw-value ...)))

I also want to supply my custom formatting for italics & friends, so
that

This is /italic/.

can become e.g.

This is <span class="emphasize">italic</span>.

I'm considering writing a custom (derived) export backend, but maybe
that is an overkill?  Any ideas?

TIA,

-- 
Marcin Borkowski
http://mbork.pl



reply via email to

[Prev in Thread] Current Thread [Next in Thread]