From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id qHrsE5wDEGa0zwAA62LTzQ:P1 (envelope-from ) for ; Fri, 05 Apr 2024 15:58:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id qHrsE5wDEGa0zwAA62LTzQ (envelope-from ) for ; Fri, 05 Apr 2024 15:58:52 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=fUCfucNQ; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1712325532; a=rsa-sha256; cv=none; b=OwqGACTZ24uSrDfj8DHb7FBJKY64hr0BW8/JFu9VtNQjio49SuZ9OLgUpC0QG6v9wwUC+R mdL/qJ5yvuHnF70xuxn7YsiAePfDAkEBq2Vax3sGs9tN0Q+CnOjQ3ivWB6x6VOLkBgwIgv JsbpUPXbnPGxlB+1owuEL2ZRB1LI+i0/r/S1n375UVwz58tglqSZAQmtG2bZpq0YYSvGr2 ZAp3Ql742UCnp1qXOzKSSHfwlWx3v4HzVgCHd/yjeYWS44SOJISaZpF6teUYs7cWqFF6o1 ZtYMwMwx3nhA+wCQZ7qQP909c2ScvI3TBlM3u6jlNsZo+OuDgpFLokJZe5aqeA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=fUCfucNQ; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1712325532; 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=iu/J8HiQOkBqkBjUTKJI7JfrgLIXSC2cd8Lg1rRq2Ns=; b=HH9dm6QXiiW6Dz01uW4P8tujrt1fCMN7/ztDg3b/y91S+admU1ySP+LzRkR6OFYvOGX2P/ ulh9NUYCwTM8eLj87ZksKq26gSwl8JWRl5wWx7Q6yokpOGJ9JMgs2OSB03D1Q14m2uOVVC qD4vH1x4JsJ1selcmiV9xirlEDjWWPwe7CVWmXznR38GtpvnwBBm8x83eTR6wdkaFBM2fd yeEAb5Mp3oWLOSpsHRZR9JM+rLnQ1n57md4bmTE36bNeBROUSBI6TDEtYzDAp8DlknNfl8 QRY08QlXEihkv2aJrC3pxYvJ1YnuST47gpvLkF3E4Po228bC3y5Hp3zW0b1ZJg== 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 47AF06A5B2 for ; Fri, 5 Apr 2024 15:58:50 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rsk59-0003RV-II; Fri, 05 Apr 2024 09:58:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rsk53-0003JQ-EN for emacs-orgmode@gnu.org; Fri, 05 Apr 2024 09:58:10 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rsk51-00040D-37 for emacs-orgmode@gnu.org; Fri, 05 Apr 2024 09:58:09 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 812E6240028 for ; Fri, 5 Apr 2024 15:58:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1712325483; bh=nBOKZAiM1HKoMim20TQIBOnsHW4KL+gevnuSdKpsJYg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=fUCfucNQ8djh1iEgEz3ny0M785fFLSxB/FbYMAC8yQ9Z6nlU6aoo5UjFwTyOMWxzi bl+LXIY8i3TdPn0Z4A72qRx+boXVxuyW+m8eCaxERuxTHd2NFoI/UZ7yeucx0u6wpH TbzxrQ3g3ZW/GCZSiptwAjkaN40okJTmdHc25b6ZcXpi5SfC3b5tEYHJKiWjuSWC8E PcCL5zkQJaoxPVaF1B6B5xv5Y4B2ZTv9ebQr36wQP9XoTjEHJeRq5r7imJghfnnmzK MzLFLUorOPsxFRQvY7H6Gjys+XW2i2EIxG3FN70n+4Nat4NNKX+ypMN04s2HAIfTpl Bl8HpKNV55H9A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VB0SB2gKlz9rxF; Fri, 5 Apr 2024 15:58:01 +0200 (CEST) From: Ihor Radchenko To: Rudolf =?utf-8?Q?Adamkovi=C4=8D?= Cc: dongdigua , emacs-orgmode@gnu.org Subject: Re: [PATCH] org-faq.org: rename org-export-htmlize-* options to org-html-htmlize-* In-Reply-To: References: <875y77wm6u.fsf@localhost> <87a5m92wqw.fsf@localhost> Date: Fri, 05 Apr 2024 13:58:18 +0000 Message-ID: <87y19roqrp.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: -9.46 X-Migadu-Queue-Id: 47AF06A5B2 X-Migadu-Spam-Score: -9.46 X-Migadu-Scanner: mx10.migadu.com X-TUID: GZ10N7Jtahgj --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Rudolf Adamkovi=C4=8D writes: > While you are on it, ... > ... See the attached updated patch. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=v2-0001-org-faq.org-How-can-I-preserve-faces.-Update-answ.patch >From b4942ba19db7e7b2c250e3dc2c5b0c6b6b7346d0 Mon Sep 17 00:00:00 2001 Message-ID: From: Ihor Radchenko Date: Thu, 4 Apr 2024 14:22:01 +0300 Subject: [PATCH v2] org-faq.org (How can I preserve faces...): Update answer * org-faq.org (How can I preserve faces when I export an agenda from the command line?): Fix the answer, making sure that the instructions actually work on the latest Org mode. Link: https://list.orgmode.org/orgmode/PS2P216MB113830307EE638A1FF044F55A024A@PS2P216MB1138.KORP216.PROD.OUTLOOK.COM/ --- org-faq.org | 51 +++++++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/org-faq.org b/org-faq.org index 3674165c..97c85c23 100644 --- a/org-faq.org +++ b/org-faq.org @@ -3643,41 +3643,48 @@ ** How can I preserve faces when I export an agenda from the command line? #+index: Export!Agenda #+index: Export!Faces -Normally, when you export an org file or an agenda view from within -emacs, htmlize will convert your face definitions to direct color css -styles inlined into each == object, resulting in an HTML output -that preserves the general look of your Org buffers and agenda views. +Normally, when you export an agenda view from within Emacs, htmlize +will convert your face definitions to direct color CSS styles inlined +into each == object, resulting in an HTML output that preserves +the general look of your Org buffers and agenda views. Let's say you generate an export from the command line, such as the following: -: emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")' - -or - -: emacs -batch -l ~/.emacs -eval '(org-publish-all)' +: emacs -batch -l ~/.emacs.d/init.el \ +: -eval '(progn \ +: (org-agenda nil "a") \ +: (org-agenda-write "~/agenda.html"))' In such an instance, the exported HTML will contain only very basic color styles. The reason is that when Emacs is run in batch mode, it does not have a display and therefore only rudimentary face definitions. If you'd like to use more complex styles, you'll have to -make sure that the export process only assigns classes instead of -direct color values. This can be done by binding the variable -=org-export-htmlize-output-style= to =css= for the duration of the -export, for example with - -: emacs -batch -l ~/.emacs -: -eval '(let ((org-export-htmlize-generate-css (quote css))) -: (org-batch-agenda "e"))' +supply custom CSS styles to make these classes look any way you like. +To generate face definitions for a CSS file based on any faces you are +currently using in Emacs, you can use the following command: -Then you can use a style file to make these classes look any way you -like. To generate face definitions for a CSS file based on any faces -you are currently using in Emacs, you can use the following command: +#+begin_src emacs-lisp +(defun org-html-htmlize-generate-css-for-agenda () + "Create the CSS for all font definitions in the current Emacs session. +Unlike `org-html-htmlize-generate-css', do not prepend +`org-html-htmlize-font-prefix' to face names." + (interactive) + (require 'ox-html) + (let ((org-html-htmlize-font-prefix "")) + (org-html-htmlize-generate-css))) +#+end_src -: M-x org-export-htmlize-generate-css RET +: M-x org-html-htmlize-generate-css-for-agenda RET This will generate a == section, the content of -which you can add to your style file. +which you can manually copy to your style file: + +: emacs -batch -l ~/.emacs.d/init.el \ +: -eval '(let ((org-agenda-export-html-style \ +: "")) \ +: (org-agenda nil "a") \ +: (org-agenda-write "~/agenda.html"))' ** How can I avoid dark color background when exporting agenda to ps format? :PROPERTIES: -- 2.44.0 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--