From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 KFLjBo7X1WI0kAAAbAwnHQ (envelope-from ) for ; Mon, 18 Jul 2022 23:58:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id MDaiBo7X1WL8hQAAauVa8A (envelope-from ) for ; Mon, 18 Jul 2022 23:58:38 +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 97715EBF1 for ; Mon, 18 Jul 2022 23:58:35 +0200 (CEST) Received: from localhost ([::1]:40326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDYl8-0001ii-BM for larch@yhetil.org; Mon, 18 Jul 2022 17:58:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDYjN-0001hJ-Fg for emacs-orgmode@gnu.org; Mon, 18 Jul 2022 17:56:45 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:33536) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oDYjL-0004U1-AS for emacs-orgmode@gnu.org; Mon, 18 Jul 2022 17:56:44 -0400 Received: by mail-pl1-x62b.google.com with SMTP id v21so10255743plo.0 for ; Mon, 18 Jul 2022 14:56:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=F2+IIWIIjX2M+sQts+1Ng2Ovpv7OknTGwnxnYQXtcyo=; b=kawhJFTWNTjVPfD5GziER7HANV+GY528v8eVbYupjmUX1GaFJqW/UAXm3e/AUCcf7j HbMDGgyo3FZ9ixLnLtrHe1NHllprYcrAJMmWWsHc2lw8JXlbOMh4+n3Zh62uSgiLKMIU yg9w/G6wnliFxS4Xj5mUIR8roA1E1B5F7jXjIKZ0sEMmiVleMW6bWRzpF9dkDv8bAm4i Oq5rJ7zyWGcasusgW+26DtsI8DKW6TtxWfhAr/wW7vNCUxQUQyo0w706Q4FKgoak0kCy VbF4s2j4H5GHQeUx7mj0axlGtmenaQDpctqazn3hPKTlIbISHcTW+GH/jA5J7jPA1ijR bDmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version:content-transfer-encoding; bh=F2+IIWIIjX2M+sQts+1Ng2Ovpv7OknTGwnxnYQXtcyo=; b=aMMcHouMB27Zic0xOU9L8RfVf0k+SfXehg1WxxUpqHwrmgo9SVJ+Tl7mIYbzqHQ/xy ChdI7iN8H6xLyPEHROa5VFxA+WnTDwRM6Pou31fY8t+EGP2jewOCk6EBk0mRsbpgXgg3 hJU4vgMo5pXBhINVvyDpw21q2vuZQC3rpBDdbK7M5pVNwkSITiuixclXKsyj7Fpbtpdd Tx/ABF459bAAsy0OnzgOwHa0sjfF2QxWYNTHQ8DwKP4cqPUdsO4U0bK1qS2KgMpZ9uOw 8pPPCdTNLpNlrKv7pe2L97bunCwECLpF6OrjQ8QIND9t5rdffxf6btpNfeS+SvMVtHQP BIrg== X-Gm-Message-State: AJIora8es50fqe0ptCHHJ1OUk+b65RuLiqiDUc46rlyK4l6x7lwXrKkr b6NIHQEl06Dt689N7gIKmRSPVflsj+SkHA== X-Google-Smtp-Source: AGRyM1vV8tigRvBhvd0TTTHgww/m+Bm0c52ioDsVZKFFq8HNenIPG2IqefvIW58cMamy2bxunPsHtg== X-Received: by 2002:a17:90b:f86:b0:1ef:90f2:884c with SMTP id ft6-20020a17090b0f8600b001ef90f2884cmr34090115pjb.91.1658181401434; Mon, 18 Jul 2022 14:56:41 -0700 (PDT) Received: from dingbat (2001-44b8-31f2-bb00-842a-7361-87c7-2662.static.ipv6.internode.on.net. [2001:44b8:31f2:bb00:842a:7361:87c7:2662]) by smtp.gmail.com with ESMTPSA id 11-20020a17090a0f8b00b001efc839ac97sm12203271pjz.3.2022.07.18.14.56.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 14:56:41 -0700 (PDT) References: <87zgh7i9vk.fsf@localhost> User-agent: mu4e 1.8.6; emacs 29.0.50 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: no syntax highlighting for code blocks with org-publish Date: Tue, 19 Jul 2022 07:50:47 +1000 In-reply-to: Message-ID: <864jzegk4q.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=theophilusx@gmail.com; helo=mail-pl1-x62b.google.com 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_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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: , 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=1658181516; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=F2+IIWIIjX2M+sQts+1Ng2Ovpv7OknTGwnxnYQXtcyo=; b=UVfjdZGYMX8UX4es7hCEOMRZ5VHO3Vuw6e8pviQd9jCbDAGiiYZ4lk5ZgLJxwPKdIlBMl5 GK5aydnb2VmlWql9y/xRALrN6qzTWSF4AqQaT7MB/b5b5oATck//OW7YTRGMo86K6f3qnS mtDf8jjEoy/RTRg0e9KlfcqDyqgvSEhiKwnITgrTZGcrcVmXNDlB/iw6VeRxUm1oa9XQMI H1/oFq536LHF1nwIj50kHO+0aXPncaDgkAincNxqPaZrdgF71JRosJLQ0fc7bl+BTWkaeA m1e+IA3QRRvMgOnvUgAkC0w+B92Ull85CksLhrMAta1JWufWEw6+EY2xwc7Uow== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658181516; a=rsa-sha256; cv=none; b=V32l/EPtWe4ZH4pt2+dEfw3vnvfZm6yHerirhw3jWfNBNFnV7g4KAwHF7a/r5RljqXA8wI HQhAsmf7KAex9QsApE+bS+0hEwMJ1JZATiIWqIz/9h2jSTxtohnzIWGQiQDYGJ0l+JK6QF BJxBTjYhnrFLcjGwtpuCyNw9zFDlXMY01vAP3tjNBxs4vPgECzeYLFAdzc1GgsBt4ZRoND Ep0+FPBR88jrBQOEBVJMNHqDyGVBSgOXizlx3KW8Q7G7XWS5zcAFtnkBsnXqonH2cF1J0m iuNb4ulIZYAISESNQwoCNfwwCagAs0CD8pP0RRzduQTFsDf1emUMM5G6eAv6sQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=kawhJFTW; dmarc=pass (policy=none) header.from=gmail.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.94 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=kawhJFTW; dmarc=pass (policy=none) header.from=gmail.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: 97715EBF1 X-Spam-Score: -3.94 X-Migadu-Scanner: scn1.migadu.com X-TUID: FLLWVnAeBnOO "M. Pger" writes: > 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 = the 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/package= s/")) > > ;; * 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 th= e 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 > (list > (list "pages" > :recursive t > :htmlized-source t > :base-directory "./content/" > :base-extension "org" > :publishing-directory "./html/" > :publishing-function 'org-html-publish-to-html > :with-creator t > :with-toc t > :section-numbers nil > :time-stamp-file nil) > )) > > ;; * 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 publishe= d 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.e= l~) and compare with > the output from ~C-c C-e h o~. The latter has syntax highlighting, the fo= rmer has not. > Just a shot in the dark. Does syntax highlighting work if the source block is something like emacs-lisp rather than R? I know that syntax highlighting is based on the syntax highlighting from the mode used for a specific language. I'm wondering if your not getting syntax highlighting because in yhour publish script, R mode is not loaded, but when you open the org file and do a 'normal' export, R is loaded and so you get syntax highlighting. Therefore, I would try the same experiment, but instead of a source block of R code, I would try a source block of emacs-lisp code as we know that emacs-lisp mode will be loaded. Could be completely off track though!