From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Giovanni Biscuolo Newsgroups: gmane.emacs.help Subject: Re: org-publish: can I use a function in :html-preamble-format? Date: Tue, 23 Mar 2021 11:36:11 +0100 Organization: Biscuolo Worldwide Network Message-ID: <87a6quw410.fsf@biscuolo.net> References: <87im5jw6pi.fsf@biscuolo.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24231"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 23 11:36:47 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lOeP0-0006Cg-Fj for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 23 Mar 2021 11:36:46 +0100 Original-Received: from localhost ([::1]:60730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOeOz-0001MC-Hh for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 23 Mar 2021 06:36:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOeOe-0001Lp-UW for help-gnu-emacs@gnu.org; Tue, 23 Mar 2021 06:36:24 -0400 Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]:41917) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOeOc-0000Yi-9F for help-gnu-emacs@gnu.org; Tue, 23 Mar 2021 06:36:24 -0400 X-Originating-IP: 93.56.171.5 Original-Received: from bourrache.mug.xelera.it (unknown [93.56.171.5]) (Authenticated sender: giovanni@biscuolo.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 91A53C0008 for ; Tue, 23 Mar 2021 10:36:18 +0000 (UTC) Original-Received: from roquette.mug.biscuolo.net (roquette [10.38.2.14]) by bourrache.mug.xelera.it (Postfix) with SMTP id B6E1FD31AE8 for ; Tue, 23 Mar 2021 11:36:13 +0100 (CET) Original-Received: (nullmailer pid 32445 invoked by uid 1000); Tue, 23 Mar 2021 10:36:12 -0000 In-Reply-To: <87im5jw6pi.fsf@biscuolo.net> Received-SPF: pass client-ip=217.70.183.198; envelope-from=giovanni@biscuolo.net; helo=relay6-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:128524 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hello, I solved this with a backquote (instead of quote), I write this just in case someone need an example (of what NOT to do :-D ). Giovanni Biscuolo writes: [...] > 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--- OK the code above was included as part of <> in a list like this: =2D-8<---------------cut here---------------start------------->8--- (setq org-publish-project-alist '( <>)) =2D-8<---------------cut here---------------end--------------->8--- In this way all the sites_config part is _quoted_ (see the quote ad the beginning of the org-publish-project-alist). If I want the xmlgen code above to be evaluated, I have to backquote the list and use the evaluator symbol (",") for the (xmlgen ...) block; this way: =2D-8<---------------cut here---------------start------------->8--- (setq org-publish-project-alist `( [OMISSIS] :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")))))))) =20=20=20=20=20=20=20=20=20=20=20 =2D-8<---------------cut here---------------end--------------->8--- ...OK, lesson learned! :-D Happy hacking! Giovanni. =2D-=20 Giovanni Biscuolo --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJKBAEBCgA0FiEERcxjuFJYydVfNLI5030Op87MORIFAmBZxJwWHGdpb3Zhbm5p QGJpc2N1b2xvLm5ldAAKCRDTfQ6nzsw5EktFEACdFbqcH6iR+MPjXE0FeuunYIwM aHZ4FyFMlYcQDPPxJPWrpMMf6Lp+0XCSaOmdxrqUe7noRgOPUOi9dJ0lmAe0hooz 3FWfKfZKODxTHVC4mXxuFZNVXTiur2Y6c0jmCzZ3skevEe3idr32Z5YeaoEl/L8X 5qGTMJvdnN4ZNNWGJOfbjh3IJ2gjF0OZKQfLL3lFffQ5s3qGutO/WRbWvk3KgcqN 7jem2WxuSojpxuL9B1WZ7W4A9/IA0L1v5R8RN/O+Fo+HYxg0UZgcrOlaIkfvTImF QSdbych9ZabVCehXeSEFYPMJQkGLzkYxzL/SJDeb4ZqyZqr81yHrDfoUoUV/U/wz nEh6NxKU11j5BEwXREnEVwwnqf9VpuY6zLZjI9fmW3Jh4y/jG31GeMH9DqAb/WSY QfCvekaiBM5Nbmtietz9qJRPWcFr8N8/eaNXUHaCzRGNuamvyWNzxCRIBx5zCW2k XMnkEJ7DHQKfGWpzxy0n04QzAMmRuEu7Th3xN9qEul0Ck+/JHM4i7oGimJDrQUi2 rkdibmSSIZaCC8jyT700kixC9/D26I5CjqlVww3zfS1EIr8VL6KOxfehrq2Ylj9l ghAj0/wh5ApsMCB+vviFJVtBxXR/gzbgZ0sUK1PuCEYAqy7lAn1SEOtWF2/g60Oc 9Bt7H/TOYRi53p2yuw== =kKav -----END PGP SIGNATURE----- --=-=-=--