From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Cross Subject: Re: Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export. Date: Wed, 02 Aug 2017 07:58:05 +1000 Message-ID: <87379bar2q.fsf@gmail.com> References: <71359491574f233bd37d0804042fb701@wilkesley.net> <87ini7d3aj.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcfB8-0004cI-EP for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 17:58:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcfB7-0002xl-Em for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 17:58:14 -0400 Received: from mail-pf0-x22a.google.com ([2607:f8b0:400e:c00::22a]:33931) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dcfB7-0002wU-A3 for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 17:58:13 -0400 Received: by mail-pf0-x22a.google.com with SMTP id o86so9537689pfj.1 for ; Tue, 01 Aug 2017 14:58:11 -0700 (PDT) In-reply-to: <87ini7d3aj.fsf@gmx.us> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Rasmus Cc: emacs-orgmode@gnu.org 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 writes: > >> This patch fixes this: >> >> From e57e9e798dd1a54cae7a633fc67e2f825b967eea Mon Sep 17 00:00:00 2001 >> From: Kaushal Modi >> 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 >> 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\n" title) >> + (when (plist-get info :with-title) >> + (format "%s\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 > 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 > > --- > 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