From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id sIrkK/0g1WI33QAAbAwnHQ (envelope-from ) for ; Mon, 18 Jul 2022 10:59:41 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id uO7hK/0g1WLBbwAA9RJhRA (envelope-from ) for ; Mon, 18 Jul 2022 10:59:41 +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 38B6323648 for ; Mon, 18 Jul 2022 10:59:41 +0200 (CEST) Received: from localhost ([::1]:53796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDMbL-0007Kd-Vh for larch@yhetil.org; Mon, 18 Jul 2022 04:59:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDMZe-000670-0o for emacs-orgmode@gnu.org; Mon, 18 Jul 2022 04:57:54 -0400 Received: from mail-4324.protonmail.ch ([185.70.43.24]:18019) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDMZb-0003Rh-19 for emacs-orgmode@gnu.org; Mon, 18 Jul 2022 04:57:53 -0400 Date: Mon, 18 Jul 2022 08:57:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1658134667; x=1658393867; bh=2Id0AmWyMPrG3JvmqfQt0XhhvqflDc4Sj7fuvAyPNo0=; 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=qh/5meVzYHJA7LfyoW9z1r7isote66rjq+muqKqcZOEqe5JBCjWJKOuRzCsNQLffz 6FyYosJObEKO1IOldjG2UhHRx6njG7ctdCG8Lywpn4sYNjiAh48nh3RwbsWK1qQ+qD W0nbbTp7WmSgoB6Lo1iyoMAdsCHU+r7CU2dgsztkufjsS978w6yDW//I14ym8MIbaa FG7V1MpNaLkzPgn4bnXQnXfQR+jkzOPsheZMQDXyN7qEoWPS1h+sJBkLh1VpPKvqye NnL2y59XwfM/afoSH8jYLF6JjtfPnDOk8T7Y/jOGXgmW6Q63mAZ5e7829HO92VLGlQ aYjvEPvnRQ2IA== To: Ihor Radchenko From: "M. Pger" Cc: emacs-orgmode Subject: Re: no syntax highlighting for code blocks with org-publish Message-ID: In-Reply-To: <87zgh7i9vk.fsf@localhost> References: <87zgh7i9vk.fsf@localhost> 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.43.24; envelope-from=mpger@protonmail.com; helo=mail-4324.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, RCVD_IN_MSPIKE_H2=-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=1658134781; 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=2Id0AmWyMPrG3JvmqfQt0XhhvqflDc4Sj7fuvAyPNo0=; b=JV20miP5lig3Z3WqwiX5UUkBBqYq/mCkbLw3AVLA6dRbfPhnFl0XPC/S5Mat/MB6vaKRXw BxeZ/lxXv2V0soXriQPc1lSm7puPiESZlku42AyQsqvyd/wv4v12m1yNj9Dq4Uoq+Tz7VX 4qL5IOz+cUucUfTGXI26r3wxOSUaYGAakdm+ZgNl6ekjmv5xdjoxJjd5gWFJyzscf3EwqK q0eMZ8h/oyhRugs6rEOvCuTS+2tWMIW6gh/LJQPl7UwJ9GsE0Byahw76C2AN8kUW8G/vvb thycM38n8SqpHuocL95HIV08u3TjRhND4x79D4My8j+f4H6xLywSozUVgKIwxA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658134781; a=rsa-sha256; cv=none; b=uj1As3g7MHVV+gXps5ol/UqLcwkyqYWAuA5dZBQYHpd/SJPBawtP60ZJcABFiIzkSTUD7O 9xwa1DaDlelkWJ4E5HUuAj8r/y4ZpTETKSfdfBfoaSFFEoUG65FUr/Ug13wt963o1rzicD LGfMyQVcQ5GuCxcjliaSh86MjbrjGwi6GYGcslmr28YjSAwOHtj5R6664l/Ed7WpUYCPrF rDp4BHmbmVL5Fth2SQgKSwjMeT7Uz7gd3bmU4xKbXBrQitNY9R2XGOYWon6mxwheqTp8kG U1juvXPmECKFBc3n3l9SMDApC/qV+WzfX8FxEMQTSlrA7wx0yu9wRP1N7ll/zA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail3 header.b="qh/5meVz"; 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: -9.03 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail3 header.b="qh/5meVz"; 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: 38B6323648 X-Spam-Score: -9.03 X-Migadu-Scanner: scn0.migadu.com X-TUID: f4Cx3MRH1OLx Thank you for your answer. Here it is: 1. Create the following directory structure (3 directories): ~/test/ =E2=94=9C=E2=94=80=E2=94=80 content =E2=94=9C=E2=94=80=E2=94=80 html =E2=94=94=E2=94=80=E2=94=80 .packages 2. Create the .el script to build the website (=3D~/test/build.el=3D): #+begin_src elisp ;; * Set the package installation directory (in order not to overwrite th= e standard ~/emacs.d) (require 'package) (setq package-user-dir (expand-file-name "./.packages")) (setq package-archives '(("melpa" . "https://melpa.org/packages/"))) (add-to-list 'package-archives '("elpa" . "https://elpa.gnu.org/packages/= ")) ;; * Initialize the package system (package-initialize) (unless package-archive-contents (package-refresh-contents)) ;; * Install dependencies ;; ** since org is builtin, by default Emacs does not try to install the = latest version from Elpa (9.5.4) ;; the following solves the issue: (defun mpger-ignore-builtin (pkg) (assq-delete-all pkg package--builtins) (assq-delete-all pkg package--builtin-versions)) (mpger-ignore-builtin 'org) ;; ** install packages: (package-install 'org) (package-install 'htmlize) ;; * Load the publishing system: (require 'org) (require 'htmlize) (require 'ox-publish) ;; * Define the project (setq org-publish-project-alist =09(list =09 (list "pages" =09 :recursive t =09 :htmlized-source t =09 :base-directory "./content/" =09 :base-extension "org" =09 :publishing-directory "./html/" =09 :publishing-function 'org-html-publish-to-html =09 :with-creator t =09 :with-toc t =09 :section-numbers nil =09 :time-stamp-file nil) =09 )) ;; * Generate the site output (org-publish-all t) (message "Done!") #+end_src 3. In =3D~/test/content/=3D, create a simple test.org file to be published = as html (=3D~/test/content/test.org=3D): #+begin_example * Here's some text Lorem ipsum. * Here's some code #+begin_src R :results output :exports both df <- mtcars ## a comment library(parallel) #+end_src #+end_example 4. Run =3D~/test/build.el=3D (e.g. with ~emacs -Q --script ~/test/build.el~= ) and compare with the output from ~C-c C-e h o~. The latter has syntax hig= hlighting, the former has not. Best, M ------- Original Message ------- On Monday, July 18th, 2022 at 1:42 AM, Ihor Radchenko = wrote: > "M. Pger" mpger@protonmail.com writes: > > > While syntax highlighting for code blocks is correctly implemented when= I export a Org document with M-x org-html-export-to-html, it does not work= when the same document is exported as part of an org-publish project defin= ed using org-publish-project-alist. > > > > Org-version: 9.5.4 (also tried with 9.5.2) > > Htmlize-version: 1.57 > > > > Note that including :htmlized-source t does not solve the problem. > > > > Any idea of what's happening? > > > May you provide an example reproducer? > > Best, > Ihor