emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@gnu.org>
To: TEC <tecosaur@gmail.com>
Cc: Jens Lechtenboerger <lechten@wi.uni-muenster.de>,
	org-mode-email <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] Enhance org-html--build-meta-info
Date: Mon, 14 Dec 2020 07:04:26 +0100	[thread overview]
Message-ID: <87im94ordh.fsf@gnu.org> (raw)
In-Reply-To: <87blexel9f.fsf@gmail.com> (TEC's message of "Mon, 14 Dec 2020 00:12:28 +0800")

Hi Timothy,

TEC <tecosaur@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 <tec@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."
>  \f
>  ;;; 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


  reply	other threads:[~2020-12-14  6:06 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 13:50 TEC
2020-09-17 14:21 ` TEC
2020-09-17 15:53 ` Jens Lechtenboerger
2020-09-17 16:14   ` TEC
2020-09-18  8:11     ` Jens Lechtenboerger
2020-09-25 17:48       ` TEC
2020-09-27 15:17         ` Jens Lechtenboerger
2020-09-27 17:39           ` TEC
2020-09-27 18:00             ` Jens Lechtenboerger
2020-09-27 18:35               ` TEC
2020-09-28  8:17                 ` Jens Lechtenboerger
2020-12-13 16:12                   ` TEC
2020-12-14  6:04                     ` Bastien [this message]
2020-12-14  6:34                       ` TEC
2020-12-14  7:20                         ` Bastien
2020-12-14  7:27                           ` TEC
2020-12-14  8:11                             ` Bastien
2020-12-14 10:01                               ` TEC
2020-12-14  9:49                       ` Jens Lechtenboerger
2020-12-15 11:39                         ` TEC
2020-12-16  4:13                           ` Tom Gillespie
2020-12-16  5:04                             ` Timothy E Chapman
2020-12-16  6:45                               ` Tom Gillespie
2020-12-16  6:55                           ` Jens Lechtenboerger
2020-12-16  7:22                             ` TEC
2020-12-16  8:37                               ` Jens Lechtenboerger
2020-12-20  5:08                                 ` TEC
2020-12-20  5:08                                 ` TEC
2020-12-20 17:59                                   ` Jens Lechtenboerger
2021-01-02 18:51                                     ` TEC
2021-01-03 13:26                                       ` Jens Lechtenboerger
2021-01-03 14:48                                         ` TEC
2021-01-03 15:41                                           ` Jens Lechtenboerger
2021-01-03 17:17                                             ` TEC
2021-01-04  7:11                                               ` Jens Lechtenboerger
2021-01-10 15:52                                                 ` TEC
2021-01-10 17:02                                                   ` Jens Lechtenboerger
2021-01-10 20:36                                                     ` TEC
2021-01-14 10:36                                                       ` TEC
2021-01-14 15:59                                                         ` Jens Lechtenboerger
2021-01-14 16:02                                                           ` Ready to merge! " TEC
2021-01-21  4:05                                                         ` Kyle Meyer
2021-01-21  5:55                                                           ` TEC

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87im94ordh.fsf@gnu.org \
    --to=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=lechten@wi.uni-muenster.de \
    --cc=tecosaur@gmail.com \
    --subject='Re: [PATCH] Enhance org-html--build-meta-info' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).