emacs-orgmode
[Top][All Lists]
Advanced

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

Re: How to export to the simplest possible HTML?


From: Thomas Redelberger
Subject: Re: How to export to the simplest possible HTML?
Date: Sat, 10 Jun 2023 10:25:45 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.1

Dear Marcin and everybody,

I had a similar requirement for "simplest HTML" and have documented (incl. 
source code) how I tackled this under
 http://web222.webclient5.de/doc/swdev/emacs/orgmode/html

In summary, my solution is
- a few settings in init.el:
  + org-html-text-markup-alist similar to below
  + setting org-export-allow-bind-keywords to t
- setting quite some org variables in-buffer/in the org file
- elisp to steer a final XSLT transformation of the generated HTML


I had coded a derived HTML export back-end (for Emacs 25.1) and used it quite 
for some time.
When I moved to Emacs 27.2, the derived back-end did not work any more, hence I 
changed to above approach.

Best regards
Thomas


On 2023-05-30, at 20:48, Marcin Borkowski wrote:

On 2023-05-30, at 17:32, Max Nikulin <manikulin@gmail.com> wrote:

On 30/05/2023 10:47, Marcin Borkowski wrote:
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)))

There is `org-export-string-as', but likely it is not suitable for
you. My guess is that you are going to export headings (blog posts) to
separate html files.

Correct, dear Holmes. 😉

This is /italic/.
can become e.g.
This is <span class="emphasize">italic</span>.

I am curious whether <em> is more friendly to screen readers
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/em

Good point.  You're right, I'll probably go with `<em>' then.  (The
reason I wanted `<span>' was that I wan't somewhat atypical styling,
namely letterspace.  But of course css magic can make `<em>' do this,
too.)

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

I just have noticed

(defcustom org-html-text-markup-alist
   '((bold . "<b>%s</b>")
     (code . "<code>%s</code>")
     (italic . "<i>%s</i>")
     (strike-through . "<del>%s</del>")
     (underline . "<span class=\"underline\">%s</span>")
     (verbatim . "<code>%s</code>"))
   "Alist of HTML expressions to convert text markup.

You may look into ox-html customizations such as
(:html-doctype "HTML_DOCTYPE" nil org-html-doctype)
(:html-html5-fancy nil "html5-fancy" org-html-html5-fancy)

I have never tried ox-slimhtml:
Laszlo Elo. ox-slimhtml. Mon, 14 Dec 2020 00:48:27
-0500. https://list.orgmode.org/41D2E10D-BCFF-4604-8417-B499514AF904@bald.cat

Ah, that looks interesting, too.

Thanks!




reply via email to

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