[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to export to the simplest possible HTML?
From: |
Ihor Radchenko |
Subject: |
Re: How to export to the simplest possible HTML? |
Date: |
Tue, 30 May 2023 06:21:41 +0000 |
Marcin Borkowski <mbork@mbork.pl> writes:
> ... I tried this:
>
> (org-html-export-as-html nil nil nil t '(org-export-with-toc nil))
You need (org-html-export-as-html nil nil nil t '(:with-toc nil))
See `org-export-options-alist'.
> 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)))
Just use `org-export-as'.
> 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 ...)))
Because `org-element-at-point' does not return a parsed subtree. Just a
partial one without children.
> 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?
Derived backend will be the easiest. It is not even hard. Just a few
lines of code.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>