From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4PULCqvR1mLe/wAAbAwnHQ (envelope-from ) for ; Tue, 19 Jul 2022 17:45:47 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id wKL3CavR1mIcJQEA9RJhRA (envelope-from ) for ; Tue, 19 Jul 2022 17:45:47 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 70E9791AF for ; Tue, 19 Jul 2022 17:38:30 +0200 (CEST) Received: from localhost ([::1]:56942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDpIr-0002KZ-2D for larch@yhetil.org; Tue, 19 Jul 2022 11:38:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDpFm-0008QQ-Bs for emacs-orgmode@gnu.org; Tue, 19 Jul 2022 11:35:18 -0400 Received: from mail-4027.protonmail.ch ([185.70.40.27]:44204) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDpFe-0003Zb-RC for emacs-orgmode@gnu.org; Tue, 19 Jul 2022 11:35:15 -0400 Date: Tue, 19 Jul 2022 15:34:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1658244907; x=1658504107; bh=JKEDj8x9ZtKrYyWk8kb/zAkqwtaqM8YfZTQ6Cyi5Dt8=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=ipjWAU6kryqI5U4xVFcVnJyJATWp21wtDoTOmCZeamtkEsQUhEac11AoOEWmiSKO0 sEPy3ouVp1c72iohRltboqtqGmUvgwNvqhzIfBtOcsjbhxl981qyhibRU7oD/0c2jA vH/MwXZQwLe9nxDyzDGTxJKrr4SDdfK/UzFkIY8Qe5JhP5fhQEXf6efJrAm/t/t4oX wDMSd+R2mwjNBSfPhI2WjVdZurNs1YO/+nKqsty3BM7AURyl6+WWkwCPIVjycAJgpA DJ24oJK4fvb4TfNjWNwF3psQsHmnLHGGKmam8jI7GYaN/W6CpLWEdyN35syV5pdIU+ khCpq4aB4mlNQ== To: Tim Cross From: "M. Pger" Cc: emacs-orgmode@gnu.org Subject: Re: no syntax highlighting for code blocks with org-publish Message-ID: In-Reply-To: <86v8rtfrxs.fsf@gmail.com> References: <87zgh7i9vk.fsf@localhost> <864jzegk4q.fsf@gmail.com> <86v8rtfrxs.fsf@gmail.com> Feedback-ID: 44058556:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.27; envelope-from=mpger@protonmail.com; helo=mail-4027.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: "M. Pger" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1658245110; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=JKEDj8x9ZtKrYyWk8kb/zAkqwtaqM8YfZTQ6Cyi5Dt8=; b=bvza4JhMDZlMk3wi+JQKE99ZJSurNnpCfrvae2o/pxoSI1FgTOAlBgZm8LqG5oQmGKeKU/ 6vqjv+nJ1MXE+hRVzux/xl7+SIHCCvC9S/x12Nb72w9ZVL36wdyHx+IOzQ9+cEQLjfZM54 5G8WuzpXW4802RM/bPZHzzWxNdN0TedkyMW7QIUWeyevMDlv98BGlf3Ybs93yL7Tb4vWax jVyrWNnvXy+QzpRBAVqMlfGa5cnQpgtW48BapjNyjLxVNg6/KjdURTgHXgUljCPSuycV9X LMiT2hlpRxS3pSGsivZCx6Jne4Ff//MToPrL42s7vX8yJHrO9ofuigqzEYauuQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658245110; a=rsa-sha256; cv=none; b=RlJB1knc9JpZn5bCvtZlwPykHL2vTPhaon8B2BFifrmMc36jYirS0/6g+Bux+k/ZhuNvGL foNXv7G/VcuFq3okH1mKDIIlfGOLUH2RwosT2KjnEhJBTxsumvWkdl9A8NfkcgRq69p9NJ L0r6lF+8ITXrTxPv+E6H/UJculsJdSgN8QnhasekHIT7Wa1FEKwQu6gvUd9gVhkPsfS1Lq H48n+t+eaVZggKl8coD6wcSwsUd8ogrHRhmw6dYtYWrPqMunEsx40V9zNDj4id/ZuW0tr+ t52X7dmJbfC/TJQGrGvK3e7YIsoXtYwTpixkOJu235dTkvQq+HPC6iaJ/OteOw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail3 header.b=ipjWAU6k; dmarc=pass (policy=quarantine) header.from=protonmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.93 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail3 header.b=ipjWAU6k; dmarc=pass (policy=quarantine) header.from=protonmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 70E9791AF X-Spam-Score: -3.93 X-Migadu-Scanner: scn1.migadu.com X-TUID: 1l9P3btDqWVo I tried to publish using `M-x org-publish RET RET` as you= suggested, and syntax highlighting was actually implemented, thanks. Actually the problem is coming from the fact that I use `emacs -Q --script = build.el` (as a bash script) to publish the project. According to https://l= ist.orgmode.org/AE5693F1-F63D-4383-8840-0FD2DBAAC5D6@gmail.com/ (rather old= , but apparently this has not changed), font-lock-mode is not enabled by de= fault in --batch mode. Since `--script` "run Emacs in batch mode, like = =E2=80=98--batch=E2=80=99, and then read and execute the Lisp code in file"= (cf the doc), it seems that this is exactly my problem. A workaround is suggested in https://list.orgmode.org/AE5693F1-F63D-4383-88= 40-0FD2DBAAC5D6@gmail.com/, but unfortunately for me it does not work (yet)= . I am going to dig further into that. Best, M Sent with Proton Mail secure email. ------- Original Message ------- On Tuesday, July 19th, 2022 at 9:51 AM, Tim Cross w= rote: > "M. Pger" mpger@protonmail.com writes: > > > Thanks for your suggestion. I added the following: > > > > #+begin_src elisp :eval no :exports code > > (setq my-var "org mailing list") > > (message "Hello, %s" my-var) > > #+end_src > > > > When exported with ~C-c C-e h o~, syntax highlighting is implemented (w= ith colors). When > > exported with org-publish interestingly I have no color, but =3Dsetq=3D= is in bold. Would it > > be possible that ox-publish implements some kind of really basic builti= n syntax > > highlighting and ignores htmlize? > > > I tried both exporting an org file into html and publishing and didn't > get any syntax highlighting for either case. Had a closer look and > noticed it didn't look like htmlize was being loaded. Did a (require > 'htmlize) and did both an export and publish, betting syntax > highlighting for both. > > My suspicion is that for the publish option, htmlize wasn't loaded? > Maybe worth doing an explicit require and then call org-publish directly > and see if that makes any difference. > > Below is the basic publish alist setting I used. Doubt all the slots are > relevant - it was just a snippet from another project I grabbed to get > setup. > > I also run M-x org-publish orgfiles rather than the export me= nu. > > > (setq org-publish-project-alist > '(("orgfiles" > :base-directory "~/playground/org/" > :base-extension "org" > :recursive t > :publishing-directory "~/Public" > :publishing-function org-html-publish-to-html > :exclude "PrivatePage.org" > :html-style-default "" > :html-scripts "" > :html-htmlize-output-type 'inline-css > :html-doctype "html5" > :html-html5-fancy t > :html-validation-link nil > )))