From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id UJbTJ98A11+xTAAA0tVLHw (envelope-from ) for ; Mon, 14 Dec 2020 06:06:23 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id qHOiI98A118kOAAA1q6Kng (envelope-from ) for ; Mon, 14 Dec 2020 06:06:23 +0000 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 295479401BC for ; Mon, 14 Dec 2020 06:06:23 +0000 (UTC) Received: from localhost ([::1]:42876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1koh02-0008TV-6z for larch@yhetil.org; Mon, 14 Dec 2020 01:06:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kogyE-00077M-H5 for emacs-orgmode@gnu.org; Mon, 14 Dec 2020 01:04:30 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47396) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kogyD-0003s6-E0; Mon, 14 Dec 2020 01:04:29 -0500 Received: from [2a01:e35:2fe1:f780:bb7f:5d4d:df89:3517] (port=39074 helo=guerry) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1kogyC-00086i-Ca; Mon, 14 Dec 2020 01:04:28 -0500 Received: by guerry (Postfix, from userid 1000) id 93D011A60435; Mon, 14 Dec 2020 07:04:26 +0100 (CET) From: Bastien To: TEC Subject: Re: [PATCH] Enhance org-html--build-meta-info Organization: GNU References: <87pn6kfr19.fsf@gmail.com> <87v9gcz9ge.fsf@wi.uni-muenster.de> <87lfh8fkj1.fsf@gmail.com> <87zh5n1p3s.fsf@wi.uni-muenster.de> <87tuvl3fyc.fsf@gmail.com> <878scvs0z7.fsf@wi.uni-muenster.de> <87wo0fktjs.fsf@gmail.com> <874knjrtg9.fsf@wi.uni-muenster.de> <87tuvjkqzl.fsf@gmail.com> <87sgb28gd8.fsf@wi.uni-muenster.de> <87blexel9f.fsf@gmail.com> Date: Mon, 14 Dec 2020 07:04:26 +0100 In-Reply-To: <87blexel9f.fsf@gmail.com> (TEC's message of "Mon, 14 Dec 2020 00:12:28 +0800") Message-ID: <87im94ordh.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jens Lechtenboerger , org-mode-email Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.80 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 295479401BC X-Spam-Score: -2.80 X-Migadu-Scanner: scn1.migadu.com X-TUID: iDWMRIxEw7km Hi Timothy, TEC writes: > Thanks for testing this :) I haven't forgotten about this. Let's wait for Jens feedback on this patch, since he took care of testing it so far. In a nutshell, can you restate what problem is this patch fixing? Is a new option really necessary here? Are there backward compatibility considerations we should take care of? > From 1289e381aff7562df96945aa58838ad966aa9211 Mon Sep 17 00:00:00 2001 > From: TEC > Date: Thu, 17 Sep 2020 21:27:18 +0800 > Subject: [PATCH] lisp/ox-html.el: make html meta func nicer > > * lisp/ox-html.el (org-html--build-meta-info): Multi-line repeated > structure extracted to new function `org-html--build-meta-entry'. You need to have a separate changelog entry for any new function or variable. > The opportunity was taken to extract most metadata info to custom > variable `org-html-meta-tags', allowing for easy end-user modification. > --- > lisp/ox-html.el | 131 +++++++++++++++++++++++++++--------------------- > 1 file changed, 73 insertions(+), 58 deletions(-) > > diff --git a/lisp/ox-html.el b/lisp/ox-html.el > index d2f24f5c6..93014e9c7 100644 > --- a/lisp/ox-html.el > +++ b/lisp/ox-html.el > @@ -1425,6 +1425,31 @@ not be modified." > > ;;;; Template :: Styles > > +(defcustom org-html-meta-tags > + '((lambda (_title author _info) > + (when (org-string-nw-p author) > + (list "name" "author" author))) > + (lambda (_title _author info) > + (when (org-string-nw-p (plist-get info :description)) > + (list "name" "description" > + (plist-get info :description)))) > + (lambda (_title _author info) > + (when (org-string-nw-p (plist-get info :keywords)) > + (list "keywords" (plist-get info :keywords)))) > + ("name" "generator" "Org Mode")) > + "A list of arguments to be passed to `org-html--build-meta-entry'. > +Each argument can either be an list which is applied, or a function which > +generates such a list with signature (TITLE AUTHOR INFO) where TITLE and AUTHOR > +are strings, and INFO a communication plist." > + :group 'org-export-html > + :package-version '(Org . "9.5") > + :type '(repeat > + (choice > + (list (string :tag "Meta label") > + (string :tag "label value") > + (string :tag "Content value")) > + function))) > + > (defcustom org-html-head-include-default-style t > "Non-nil means include the default style in exported HTML files. > The actual style is defined in `org-html-style-default' and > @@ -1835,78 +1860,68 @@ INFO is a plist used as a communication channel." > > ;;; Template > > +(defun org-html--build-meta-entry (label identity &optional content-format &rest content-formatters) > + "Construct tag with LABEL=\"IDENTITY\" and content from CONTENT-FORMAT and CONTENT-FORMATTER." The first line of this defun is too long. You can try M-x checkdoc RET on your elisp files to catch those issues. Thanks, -- Bastien