all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Giovanni Biscuolo <giovanni@biscuolo.net>
To: help-gnu-emacs@gnu.org
Subject: org-publish: can I use a function in :html-preamble-format?
Date: Mon, 22 Mar 2021 16:26:01 +0100	[thread overview]
Message-ID: <87im5jw6pi.fsf@biscuolo.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 1923 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 865 bytes --]

             reply	other threads:[~2021-03-22 15:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-22 15:26 Giovanni Biscuolo [this message]
2021-03-23 10:36 ` org-publish: can I use a function in :html-preamble-format? Giovanni Biscuolo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87im5jw6pi.fsf@biscuolo.net \
    --to=giovanni@biscuolo.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.