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 cPpkK6FDO2PjiAAAbAwnHQ (envelope-from ) for ; Mon, 03 Oct 2022 22:18:41 +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 KDSHK6FDO2OxswAA9RJhRA (envelope-from ) for ; Mon, 03 Oct 2022 22:18: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 7F4A5173EC for ; Mon, 3 Oct 2022 22:18:40 +0200 (CEST) Received: from localhost ([::1]:60264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofRtf-0000zU-9x for larch@yhetil.org; Mon, 03 Oct 2022 16:18:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofRBC-0000yb-0o for emacs-orgmode@gnu.org; Mon, 03 Oct 2022 15:32:42 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:40740) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ofRBA-0003qM-3G for emacs-orgmode@gnu.org; Mon, 03 Oct 2022 15:32:41 -0400 Received: by mail-ed1-x533.google.com with SMTP id x59so5994438ede.7 for ; Mon, 03 Oct 2022 12:32:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=hCJM6P3GD+nmCOxQW7lbQGrwLGkDUkuuAetzEhPQhfk=; b=pNpwYzAwOXZzdRfPfC5ueWNIRuJjWRCLO8BvBtTuhOxEjL8sYDMer8R5UpNb+3tNhg rB7mcr/i81JUjrWIWLKVJAQKJhON02cbkuyOspct9/SHRmaMLA8/2vCFuTkFgI3XHz1Q IR6ZtcyVGJv3STWvS+VozQ2ZBOkao2X5W7yL8cEyXkNvDG763KNk2m85N9oyc0jph9rs NL5f+Ypv3AvmyjsSfamf5mBh2JuBt0DvTBDAmfLA8nTdADizF+t1PM8ReCxG6BnrJeUg 2gXMwkz2Hjj6CqBkEQulS1bJTGzJ1xsTQSQz3KnfI5qu45EiLhjuxtq9SWzJGtvdQOlr MxKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=hCJM6P3GD+nmCOxQW7lbQGrwLGkDUkuuAetzEhPQhfk=; b=EL2TIrAWnGcckWi0mgz/RIexFEV4VlGdRtBejlb+hjPBYJpoKN6JgqNRxuwkqGL9ku k61M9tJvmFkq2fB3cre3eHprpzZ8TKT5PoQ9giDpFJSftylNDIcknZ//c+yC5pzs75mk F3F2z/KOVYvx4cmjDeFEKwvyMAAQWqFSWlPJumyfhVzd+Q6hmJ8MimlspeMl8p9A1ql6 4ajWc/yFh45qIqBiuPlG/Uwmw+kxalCK+/rtJl1Rc2B8gO1i33TirmRt4wnWZIYtvIp7 En2zsMXhz68CMy1pH07gHWsiFOt7IorOrlfrAs2B7PzGQUEi3GvCRQk62EMCvyZ5hSDI g7ug== X-Gm-Message-State: ACrzQf0aH5M2JqUnFW2KfAFdPZyDPCldijb78aKWYHWe5F3HHWGepThx 2OughjWDLdpTAASItXeuORN2roBV2t1BKX5QTAs= X-Google-Smtp-Source: AMsMyM650rKuv657RTjZoBTDMiSJ8ErqGxLlhC1AnlkTo0eIWn6O4yeZe81oFa93/Mh0epxCAUqshdc8wMFLhDpkFHs= X-Received: by 2002:a05:6402:27d0:b0:451:b381:e0a1 with SMTP id c16-20020a05640227d000b00451b381e0a1mr19450024ede.4.1664825558251; Mon, 03 Oct 2022 12:32:38 -0700 (PDT) MIME-Version: 1.0 References: <878rly1ydl.fsf@localhost> In-Reply-To: From: =?UTF-8?B?RGF2aWQgTHVrZcWh?= Date: Mon, 3 Oct 2022 21:32:27 +0200 Message-ID: Subject: Re: Code block syntax highlighting in async export To: Max Nikulin Cc: emacs-orgmode@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=dafydd.lukes@gmail.com; helo=mail-ed1-x533.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 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-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1664828320; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=hCJM6P3GD+nmCOxQW7lbQGrwLGkDUkuuAetzEhPQhfk=; b=ripal082jkXqhSg6/XWECY9YD3gFlBO3rdDpSZcDdBTvIqc3ximVTaCMM8bry4YtAPgiGS m59PKpFsl0Y+yb0eQ16kZNUsXblwnE7A4HFqDGixeZ2dsFqDjO67qKHci6aLJKbaIdy8bq JYiPE1cTxEAQTaVOBZBEMHklU6sGTG3ht25mZdXqKIXt65jD/TIvpdaz3y2KTG/O+kGffc 5T63cG/AI7w0tYawlBltSNx/Ch4nmQ4QR9WB4/vREt7+afcGRVqg1qevwmH1Wm6yKGLITR 5GWSBSx9WmlFZjGH9L88XkG9cwaz43KupmFEwSJ5Q00or3qcB5JNOUNTEKec9Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664828320; a=rsa-sha256; cv=none; b=ieT6TRIMy1t5HXyW8ZMDu4hWUDaEWXtXX3ZAdU7kwfhE3E9tv0Yo9s+Mvy73Tu0F+TZ9w0 jMGKPIjPWM99lTNBSS/bY3PLvSZTPEUDs2IkqKNDArUl2EQLA5YW0CgoppX1AYW7Z65/xo Z+eBVSot/qc4WTtyyu2MafsGkmKWmkAGagzhaMp6nkY0NOCJyrmQUPWPBboiuwaLBUQ1Bp Ew1Jxm2GX1kq7nikGRPYSO8YOWBGIzEe527fG4Kpu5fedQtnfXL17mqdbkTR7G8qZ6GWxV bitMF9ZD2LDEJs+ra6FPPaJA4ZOJUT2mC2V77buziJzGk3dA5LejqTGISEENHA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=pNpwYzAw; 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.86 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=pNpwYzAw; 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: 7F4A5173EC X-Spam-Score: -3.86 X-Migadu-Scanner: scn1.migadu.com X-TUID: TKh1HEUGPrJD > I have realized that > https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-elisp.html > has colorized source blocks. The file is created using > https://git.sr.ht/~bzg/worg/blob/master/publish.sh and the script is > executed inside a container with no available DISPLAY. Well spotted! I think the trick there is setting org-html-htmlize-output-type to 'css. See the variable's documentation: Choices are css to export the CSS selectors only,inline-css to export the CSS attribute values inline in the HTML or nil to export plain text. We use as default inline-css, in order to make the resulting HTML self-containing. However, this will fail when using Emacs in batch mode for export, because then no rich font definitions are in place. It will also not be good if people with different Emacs setup contribute HTML files to a website, because the fonts will represent the individual setups. In these cases, it is much better to let Org/Htmlize assign classes only, and to use a style file to define the look of these classes. To get a start for your css file, start Emacs session and make sure that all the faces you are interested in are defined, for example by loading files in all modes you want. Then, use the command M-x org-html-htmlize-generate-css to extract class definitions. So, still a workaround, technically, but a nice and clean one that definitely deserves to be mentioned in this context! Best, David