[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Enhance org-html--build-meta-info
From: |
Bastien |
Subject: |
Re: [PATCH] Enhance org-html--build-meta-info |
Date: |
Mon, 14 Dec 2020 08:20:38 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Hi Timothy,
TEC <tecosaur@gmail.com> writes:
>> In a nutshell, can you restate what problem is this patch fixing?
>
> There are two things I intend to achieve with this patch:
> 1. DRY* out the existing code. The existing code is quite repetitive in
> structure, and easily lends itself to being extracted to a function.
> This is easier to read, and work with IMO.
> 2. Make use of the DRYer code in (1) to provide a make the meta building
> function more versatile, and then add in the ability for user
> customisation at low-cost (again, thanks to (1)).
Can we approach this with two patches, one with the refactoring and
one with the added functionality?
> Necessary? Not really, I mean the export /works/ without it. I'd argue
> that it's desirable though, as it provides an easy way for a user (such
> as myself) to add useful meta tags not included by default.
This sounds useful.
>> Are there backward compatibility considerations we should take care of?
>
> None AFAIK. Barring this errors that Jens raised, and now have hopefully
> been addressed, this should function /exactly/ as the current
> implementation does, with a minor (beneficial) caveat, mentioned below.
> Just with nicer-to-work-with code and a bit more versatility (IMO, of
> course).
>
> These are the two changes to be mentioned:
> 1. The (or {title} "Org Export") bit I added.
> I believe the current behaviour when no #+title is given is to have a
> blank one (""). I think "Org Export" is preferable, as it's more
> informative than ... nothing.
I think "Org Export" as the default is counter-intuitive, let's stick
to the empty string. (Also, this kind of "small" changes should be
made with consideration of all exporters.)
> 2. Using org-html-encode-plain-text for formatting the content of the
> meta tags. From Jens, I take it that the current org-export-data can
> cause nested HTML tags, which are invalid in this context. Plain text
> should be safer.
Yes, this is better.
>>> +(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,
>
> I see, I'm guessing I'll just need to add a line break.
Nope, the first line of a docstring should be a sentence. You'll have
to reformulate the beginning of the docstring...
Thanks!
--
Bastien
Re: [PATCH] Enhance org-html--build-meta-info, Jens Lechtenboerger, 2020/12/14
Re: [PATCH] Enhance org-html--build-meta-info, Jens Lechtenboerger, 2020/12/16
Re: [PATCH] Enhance org-html--build-meta-info, TEC, 2020/12/16