From: Tim Cross <theophilusx@gmail.com>
To: Rasmus <rasmus@gmx.us>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export.
Date: Wed, 02 Aug 2017 07:58:05 +1000 [thread overview]
Message-ID: <87379bar2q.fsf@gmail.com> (raw)
In-Reply-To: <87ini7d3aj.fsf@gmx.us>
I think I agree. All HTML documents should have a title tag. Not all
HTML documents need a h1-title. I think the easy solution is to just
default to document name when no title is set and don't add a
h1-title. If a title block is set, then do as is now the case.
tim
Rasmus writes:
> Kaushal Modi <kaushal.modi@gmail.com> writes:
>
>> This patch fixes this:
>>
>> From e57e9e798dd1a54cae7a633fc67e2f825b967eea Mon Sep 17 00:00:00 2001
>> From: Kaushal Modi <kaushal.modi@gmail.com>
>> Date: Mon, 31 Jul 2017 14:30:40 -0400
>> Subject: [PATCH] Respect :with-title in ox-html
>>
>> * lisp/ox-html.el (org-html--build-meta-info): Do not insert <title>
>> tag in HTML export if :with-title property is nil. Example: by
>> setting #+OPTIONS: title:nil
>>
>> Reported by: Ian <lists@wilkesley.net>
>> ---
>> lisp/ox-html.el | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/lisp/ox-html.el b/lisp/ox-html.el
>> index aeb38ebc10..08381d0c19 100644
>> --- a/lisp/ox-html.el
>> +++ b/lisp/ox-html.el
>> @@ -1812,7 +1812,8 @@ INFO is a plist used as a communication channel."
>> viewport-options ", "))
>> info)
>> "\n")))
>> - (format "<title>%s</title>\n" title)
>> + (when (plist-get info :with-title)
>> + (format "<title>%s</title>\n" title))
>> (org-html-close-tag "meta" "name=\"generator\" content=\"Org mode\""
>> info)
>> "\n"
>> (and (org-string-nw-p author)
>
> That is wrong IMO. Title is mandatory in at least HTML{4,5}.
>
> https://www.w3schools.com/tags/tag_title.asp
>
> AFAIR Org already allows invalid HTML document to be produced when the
> TITLE is empty, as it’s translated into an empty quote.
>
> The right approach IMO is not printing the h1-title block, as in the
> attached patch.
>
> (In general generating the title block should be moved to something like
> ‘org-html-preamble-format’, though it probably shouldn’t depend on the
> language of the document...)
>
> Rasmus
>
> --
> Er du tosset for noge' lårt!
> From dace1586373df27863934675967eef8c56747a82 Mon Sep 17 00:00:00 2001
> From: Rasmus <rasmus@gmx.us>
> Date: Tue, 1 Aug 2017 11:32:44 +0200
> Subject: [PATCH] ox-html: Respect the "title" option
>
> * lisp/ox-html.el (org-html-template): Respect :with-title.
>
> Reported-by: lists@wilkesley.net
> <http://permalink.gmane.org/gmane.emacs.orgmode/114942>
> ---
> lisp/ox-html.el | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/ox-html.el b/lisp/ox-html.el
> index 06dee3af6..43e4ef8d4 100644
> --- a/lisp/ox-html.el
> +++ b/lisp/ox-html.el
> @@ -2068,7 +2068,8 @@ holding export options."
> (format "<%s id=\"%s\">\n" (nth 1 div) (nth 2 div)))
> ;; Document title.
> (when (plist-get info :with-title)
> - (let ((title (plist-get info :title))
> + (let ((title (and (plist-get info :with-title)
> + (plist-get info :title)))
> (subtitle (plist-get info :subtitle))
> (html5-fancy (org-html--html5-fancy-p info)))
> (when title
--
Tim Cross
prev parent reply other threads:[~2017-08-01 21:58 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-31 17:35 Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export lists
2017-07-31 18:24 ` Kaushal Modi
2017-07-31 18:33 ` Kaushal Modi
2017-08-01 8:15 ` Nicolas Goaziou
2017-08-01 9:51 ` Rasmus
2017-08-01 10:41 ` Kaushal Modi
2017-08-01 11:18 ` Rasmus
2017-08-01 19:41 ` Kaushal Modi
2017-08-01 20:48 ` Rasmus
2017-08-01 20:59 ` Kaushal Modi
2017-08-09 9:56 ` Rasmus
2017-08-09 10:38 ` Rasmus
2017-08-14 20:15 ` Kaushal Modi
2017-08-01 22:03 ` Tim Cross
2017-08-01 21:58 ` Tim Cross [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87379bar2q.fsf@gmail.com \
--to=theophilusx@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=rasmus@gmx.us \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.