help-gnu-emacs
[Top][All Lists]
Advanced

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

org-publish: can I use a function in :html-preamble-format?


From: Giovanni Biscuolo
Subject: org-publish: can I use a function in :html-preamble-format?
Date: Mon, 22 Mar 2021 16:26:01 +0100

Hello,

I'm a newbie with Elisp and Lisp in general; what I'm trying to do is to
customize the preamble format for a publishing-project I'm using.

I'm able to configure the HTML preamble for each project using this
configuration;

--8<---------------cut here---------------start------------->8---

("Pagine in italiano"
 :language it

[...]

 :html-preamble t
 :html-preamble-format (("en"
                        "<div><div><a href=\"/\">Home</a><span 
class=\"pre-sep\">|</span><a href=\"/colophon.html\">Colophon</a></div> <hr 
style='height:0.5px'></div>")
                       ("it"
                        "<div><div><a href=\"/it/\">Home</a><span 
class=\"pre-sep\">|</span><a href=\"/it/colophon.html\">Colophon</a></div> <hr 
style='height:0.5px'></div>")))

--8<---------------cut here---------------end--------------->8---

This works well but I'd like to use xmlgen to format the html parts of
:html-preamble-format

If I use this:

--8<---------------cut here---------------start------------->8---

:html-preamble-format (("en"
                        (xmlgen
                         '(div
                           (div
                            (a :href "/" "Home")
                            (span :class "pre-sep" "|")
                            (a :href "/colophon.html" "Colophon")))))
                       ("it"
                        (xmlgen
                         '(div
                           (div
                            (a :href "/" "Home")
                            (span :class "pre-sep" "|")
                            (a :href "/colophon.html" "Colophon"))))))

--8<---------------cut here---------------end--------------->8---

(yes I know, the HTML results of xmgen does not match with the ones above
but that's not the issue)

I get this error:

Wrong type argument: char-or-string-p, (xmlgen '(div (div (a :href "/" "Home") 
(span :class "pre-sep" "|") (a :href "/colophon.html" "Colophon"))))

If I try to evaluate the (xmlgen ...) part in a separate buffer I get
correct sting representation in HTML but in ":html-preamble-format" it
does not work.

Please what I'm doing wrong?

Thanks! Giovanni.

-- 
Giovanni Biscuolo

Attachment: signature.asc
Description: PGP signature


reply via email to

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