Hi Timothy, TEC <tecos...@gmail.com> 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 <t...@tecosaur.com> > 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 <meta> 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