From mboxrd@z Thu Jan 1 00:00:00 1970 From: lists@wilkesley.net Subject: Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export. Date: Mon, 31 Jul 2017 18:35:55 +0100 Message-ID: <71359491574f233bd37d0804042fb701@wilkesley.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcEbr-00017B-VR for emacs-orgmode@gnu.org; Mon, 31 Jul 2017 13:36:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcEbo-0006KR-Rc for emacs-orgmode@gnu.org; Mon, 31 Jul 2017 13:36:04 -0400 Received: from mail2.wilkesley.net ([176.58.110.121]:49302 helo=li40-130.members.linode.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcEbo-0006Fi-Jv for emacs-orgmode@gnu.org; Mon, 31 Jul 2017 13:36:00 -0400 Received: from wilkesley.org (localhost [127.0.0.1]) (Authenticated sender: lists@wilkesley.net) by li40-130.members.linode.com (Postfix) with ESMTPSA id 5C153DC009 for ; Mon, 31 Jul 2017 17:35:55 +0000 (UTC) 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: emacs-orgmode@gnu.org I don't know if this is intended behaviour or not. Save the following as setuop.org #+BEGIN_SRC :SETUP: #+LANGUAGE: en #+DRAWERS: SETUP NOTES PROPERTIES #+OPTIONS: author:nil date:nil d:nil title:nil ':t tex:t #+STARTUP: content indent :END: #+END_SRC Now include setup.org in test.org #+BEGIN_SRC #+SETUPFILE: ./setup.org #+TITLE: A Three Second Route. * A Three Second Route. Some text. #+END_SRC Exporting as html result in: #+BEGIN_SRC html A Three Second Route. #+END_SRC Note that TITLE is exported. Using org-master bb6e40b08655cc2f33bdf6f9 Ian. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export. Date: Mon, 31 Jul 2017 18:24:04 +0000 Message-ID: References: <71359491574f233bd37d0804042fb701@wilkesley.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="f403045f740064584d0555a123b0" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51875) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcFMa-0003tS-G5 for emacs-orgmode@gnu.org; Mon, 31 Jul 2017 14:24:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcFMZ-0006RN-0S for emacs-orgmode@gnu.org; Mon, 31 Jul 2017 14:24:20 -0400 Received: from mail-lf0-x22b.google.com ([2a00:1450:4010:c07::22b]:33896) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dcFMY-0006O9-MG for emacs-orgmode@gnu.org; Mon, 31 Jul 2017 14:24:18 -0400 Received: by mail-lf0-x22b.google.com with SMTP id g25so113457037lfh.1 for ; Mon, 31 Jul 2017 11:24:16 -0700 (PDT) In-Reply-To: <71359491574f233bd37d0804042fb701@wilkesley.net> 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: lists@wilkesley.net, emacs-orgmode@gnu.org --f403045f740064584d0555a123b0 Content-Type: text/plain; charset="UTF-8" On Mon, Jul 31, 2017 at 1:37 PM wrote: > I don't know if this is intended behaviour or not. > > Save the following as setuop.org > > #+BEGIN_SRC > > :SETUP: > #+LANGUAGE: en > #+DRAWERS: SETUP NOTES PROPERTIES > #+OPTIONS: author:nil date:nil d:nil title:nil ':t tex:t > #+STARTUP: content indent > > :END: > > #+END_SRC > I haven't seen that kind of property-drawer like syntax for setupfile before (:SETUP: .. :END:).. But looks like that's just the way you represented in this email? > Now include setup.org in test.org > > #+BEGIN_SRC > > #+SETUPFILE: ./setup.org > #+TITLE: A Three Second Route. > * A Three Second Route. > Some text. > > > #+END_SRC > > Exporting as html result in: > > #+BEGIN_SRC html > > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > > > > > > A Three Second Route. > > #+END_SRC > > Note that TITLE is exported. > > Using org-master bb6e40b08655cc2f33bdf6f9 > I can recreate this issue when using the HTML backed, not when using the ascii backend. My example: == setup.org == #+OPTIONS: title:nil author:nil toc:nil ===== == example.org ===== #+SETUPFILE: ./setup.org #+TITLE: This Title Must Not Export * Heading 1 Some text. ===== C-c C-e t A (ascii export to buffer) gives: ===== 1 Heading 1 =========== Some text. ===== C-c C-e h H (html export to buffer) gives: ===== This Title Must Not Export == == -- Kaushal Modi --f403045f740064584d0555a123b0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Jul 31= , 2017 at 1:37 PM <lists@wilkesle= y.net> wrote:
I don't kn= ow if this is intended behaviour or not.

Save the following as setuop.org

#+BEGIN_SRC

:SETUP:
#+LANGUAGE:=C2=A0 en
#+DRAWERS: SETUP NOTES PROPERTIES
#+OPTIONS: author:nil date:nil d:nil title:nil ':t tex:t
#+STARTUP: content indent

:END:

#+END_SRC

I haven't seen that kind = of property-drawer like syntax for setupfile before (:SETUP: .. :END:).. Bu= t looks like that's just the way you represented in this email?
=C2=A0
Now include setup.org in test.org

#+BEGIN_SRC

#+SETUPFILE: ./setup.org
#+TITLE: A Three Second Route.
* A Three Second Route.
Some text.


#+END_SRC

Exporting as html result in:

#+BEGIN_SRC html

<?xml version=3D"1.0" encoding=3D"utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict= .dtd">
<html xmlns=3D"http://www.w3.org/1999/xhtml" lang=3D&qu= ot;en" xml:lang=3D"en">
<head>
<!-- 2017-07-31 Mon 18:22 -->
<meta http-equiv=3D"Content-Type" content=3D"text/html;ch= arset=3Dutf-8" />
<meta name=3D"viewport" content=3D"width=3Ddevice-width, = initial-scale=3D1" />
<title>A Three Second Route.</title>
<meta name=3D"generator" content=3D"Org mode" /><= br> #+END_SRC

Note that TITLE is exported.

Using org-master bb6e40b08655cc2f33bdf6f9

=C2=A0I can recreate this issue when using the HTML backed, not when usi= ng the ascii backend.

My example:

=3D=3D setup.org =3D=3D
#+OPTIONS: title:nil author:nil toc:nil
=3D=3D=3D=3D= =3D

=3D=3D exa= mple.org =3D=3D=3D=3D=3D
#+SETUPFILE: ./setup.org
#+TITLE: This Title Must Not Export
* Heading 1
Some text.
=3D=3D=3D=3D=3D

C-c C-e t A (ascii export to buffer) gives:

=3D=3D=3D=3D=3D
1 Heading 1
= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

=C2=A0 Some text= .
=3D=3D=3D=3D=3D

C-c C-e h H (htm= l export to buffer) gives:

=3D=3D=3D=3D=3D
<?xml version=3D"1.0" encoding=3D"utf-8"?>= ;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN= "
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns=3D"ht= tp://www.w3.org/1999/xhtml" lang=3D"en" xml:lang=3D"= ;en">
<head>
<!-- 2017-07-31 Mon 14:22= -->
<meta http-equiv=3D"Content-Type" content=3D= "text/html;charset=3Dutf-8" />
<meta name=3D"= ;viewport" content=3D"width=3Ddevice-width, initial-scale=3D1&quo= t; />
<title>This Title Must Not Export</title>
=3D=3D <snip> =3D=3D

--

Kaushal Modi

--f403045f740064584d0555a123b0-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export. Date: Mon, 31 Jul 2017 18:33:50 +0000 Message-ID: References: <71359491574f233bd37d0804042fb701@wilkesley.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114b28624275e80555a14667" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcFVz-0006vw-JS for emacs-orgmode@gnu.org; Mon, 31 Jul 2017 14:34:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcFVy-0004HC-CF for emacs-orgmode@gnu.org; Mon, 31 Jul 2017 14:34:03 -0400 Received: from mail-lf0-x233.google.com ([2a00:1450:4010:c07::233]:34639) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dcFVy-0004G2-0i for emacs-orgmode@gnu.org; Mon, 31 Jul 2017 14:34:02 -0400 Received: by mail-lf0-x233.google.com with SMTP id g25so113553450lfh.1 for ; Mon, 31 Jul 2017 11:34:01 -0700 (PDT) In-Reply-To: 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: lists@wilkesley.net, emacs-orgmode@gnu.org --001a114b28624275e80555a14667 Content-Type: text/plain; charset="UTF-8" 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) -- 2.13.0 OK to commit to maint? On Mon, Jul 31, 2017 at 2:24 PM Kaushal Modi wrote: > > C-c C-e h H (html export to buffer) gives: > > ===== > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > > > > > > This Title Must Not Export > == == > -- Kaushal Modi --001a114b28624275e80555a14667 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
This patch fixes this:

From e57e9e= 798dd1a54cae7a633fc67e2f825b967eea Mon Sep 17 00:00:00 2001
From:= Kaushal Modi <kaushal.modi@gm= ail.com>
Date: Mon, 31 Jul 2017 14:30:40 -0400
S= ubject: [PATCH] Respect :with-title in ox-html

* l= isp/ox-html.el (org-html--build-meta-info): Do not insert <title>
=C2=A0 tag in HTML export if :with-title property is nil.=C2=A0 Exam= ple: by
=C2=A0 setting #+OPTIONS: title:nil

<= div>Reported by: Ian <lists@wilke= sley.net>
---
=C2=A0lisp/ox-html.el | 3 ++-
=C2=A01 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index aeb= 38ebc10..08381d0c19 100644
--- a/lisp/ox-html.el
+++ b/= lisp/ox-html.el
@@ -1812,7 +1812,8 @@ INFO is a plist used as a c= ommunication channel."
=C2=A0 =C2=A0 =C2=A0 =C2=A0 viewport-options ", "))
=C2=A0 =C2=A0 =C2=A0 =C2=A0info)
=C2=A0 =C2=A0 =C2=A0 "= ;\n")))
- =C2=A0 =C2=A0 (format "<title>%s</ti= tle>\n" title)
+ =C2=A0 =C2=A0 (when (plist-get info :wit= h-title)
+ =C2=A0 =C2=A0 =C2=A0 (format "<title>%s<= /title>\n" title))
=C2=A0 =C2=A0 =C2=A0 (org-html-close-t= ag "meta" "name=3D\"generator\" content=3D\"O= rg mode\"" info)
=C2=A0 =C2=A0 =C2=A0 "\n"
=C2=A0 =C2=A0 =C2=A0 (and (org-string-nw-p author)
--=C2= =A0
2.13.0


OK to commit t= o maint?

On Mon, Jul 3= 1, 2017 at 2:24 PM Kaushal Modi <kaushal.modi@gmail.com> wrote:

C-c C-e= h H (html export to buffer) gives:

=3D=3D=3D=3D= =3D
<?xml version=3D"1.0" encoding=3D"u= tf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML = 1.0 Strict//EN"
<html xmlns=3D"http://www.w3.org/1999/xhtm= l" lang=3D"en" xml:lang=3D"en">
&= lt;head>
<!-- 2017-07-31 Mon 14:22 -->
&= lt;meta http-equiv=3D"Content-Type" content=3D"text/html;cha= rset=3Dutf-8" />
<meta name=3D"viewport" con= tent=3D"width=3Ddevice-width, initial-scale=3D1" />
<title>This Title Must Not Export</title>
= =3D=3D <snip> =3D=3D
=
--

Kaushal Modi

--001a114b28624275e80555a14667-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export. Date: Tue, 01 Aug 2017 10:15:28 +0200 Message-ID: <87379bu2jj.fsf@nicolasgoaziou.fr> References: <71359491574f233bd37d0804042fb701@wilkesley.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcSKz-0005gi-NI for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 04:15:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcSKy-00037D-TF for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 04:15:33 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:34098) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dcSKy-00033r-Mm for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 04:15:32 -0400 In-Reply-To: (Kaushal Modi's message of "Mon, 31 Jul 2017 18:33:50 +0000") 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: Kaushal Modi Cc: emacs-orgmode@gnu.org, lists@wilkesley.net Hello, Kaushal Modi writes: > 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 [...] > + (when (plist-get info :with-title) > + (format "<title>%s\n" title)) I would use `and' instead of `when' to stress the fact that we're interested in the return value. Otherwise, LGTM. Thank you. -- Nicolas Goaziou From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export. Date: Tue, 01 Aug 2017 11:51:16 +0200 Message-ID: <87ini7d3aj.fsf@gmx.us> References: <71359491574f233bd37d0804042fb701@wilkesley.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcTpw-0000r4-BU for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 05:51:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcTpt-0004xd-Ox for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 05:51:36 -0400 Received: from [195.159.176.226] (port=34649 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dcTpt-0004wh-HF for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 05:51:33 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dcTpk-0003Ky-BI for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 11:51:24 +0200 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: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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! --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-ox-html-Respect-the-title-option.patch >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 -- 2.13.3 --=-=-=-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export. Date: Tue, 01 Aug 2017 10:41:32 +0000 Message-ID: References: <71359491574f233bd37d0804042fb701@wilkesley.net> <87ini7d3aj.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c1a1e941d7ee70555aecb09" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcUcU-00056f-Kx for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 06:41:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcUcT-0004tT-Gp for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 06:41:46 -0400 Received: from mail-lf0-x233.google.com ([2a00:1450:4010:c07::233]:33458) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dcUcT-0004sy-9f for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 06:41:45 -0400 Received: by mail-lf0-x233.google.com with SMTP id d17so5226749lfe.0 for ; Tue, 01 Aug 2017 03:41:45 -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 , emacs-org list --94eb2c1a1e941d7ee70555aecb09 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Aug 1, 2017, 5:52 AM Rasmus wrote: > > That is wrong IMO. Title is mandatory in at least HTML{4,5}. > > https://www.w3schools.com/tags/tag_title.asp Thanks, I was not aware of that. AFAIR Org already allows invalid HTML document to be produced when the > TITLE is empty, as it=E2=80=99s translated into an empty quote. > With the new patch, wouldn't the title, that was not intended to be shown, still show up in places like browser tabs and bookmarks? I have to yet try it. So I was going to suggest to set title tag to empty string "" or something generic like "HTML". I don't think I would use the title:nil option. But if one needs to hide the title, I think it should not leak out of the Org document. The right approach IMO is not printing the h1-title block, as in the attached patch. > That would be fine if that prevents the title from showing up in browser tabs, etc. (In general generating the title block should be moved to something like > =E2=80=98org-html-preamble-format=E2=80=99, though it probably shouldn=E2= =80=99t depend on the > language of the document...) > --=20 Kaushal Modi --94eb2c1a1e941d7ee70555aecb09 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Aug 1, 2017, 5:52 AM Ra= smus <rasmus@gmx.us> wrote:
<= /div>

That is wrong IMO.=C2=A0 Title is mandatory in at least HTML{4,5}.

=C2=A0 =C2=A0 https://www.w3schools.com/tags/tag_title.= asp

Thanks, I was not aware of th= at.=C2=A0

AFAIR Org already allows invalid HTML document to be produced= when the
TITLE is empty, as it=E2=80=99s translated into an empty quote.

With the new patch, wouldn't the title, = that was not intended to be shown, still show up in places like browser tab= s and bookmarks? I have to yet try it.=C2=A0

So I = was going to suggest to set title tag to empty string "" or somet= hing generic like "HTML". I don't think I would use the title= :nil option. But if one needs to hide the title, I think it should not leak= out of the Org document.

The right appro= ach IMO is not printing the h1-title block, as in the
attached patch.

That would be fin= e if that prevents the title from showing up in browser tabs, etc.=C2=A0

(In general generating the title block should be moved to something like =E2=80=98org-html-preamble-format=E2=80=99, though it probably shouldn=E2= =80=99t depend on the
language of the document...)
--

Kaushal Modi

--94eb2c1a1e941d7ee70555aecb09-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export. Date: Tue, 01 Aug 2017 13:18:13 +0200 Message-ID: <87efsvcz9m.fsf@gmx.us> References: <71359491574f233bd37d0804042fb701@wilkesley.net> <87ini7d3aj.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcVBz-0006up-0q for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 07:18:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcVBp-0004eM-FZ for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 07:18:22 -0400 Received: from mout.gmx.net ([212.227.15.15]:64440) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dcVBp-0004d5-1h for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 07:18:17 -0400 In-Reply-To: (Kaushal Modi's message of "Tue, 01 Aug 2017 10:41:32 +0000") 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: kaushal.modi@gmail.com Cc: emacs-orgmode@gnu.org Hi, Kaushal Modi writes: > With the new patch, wouldn't the title, that was not intended to be shown, > still show up in places like browser tabs and bookmarks? I have to yet try > it. Yes, but that=E2=80=99s a feature. It=E2=80=99s how ox-{latex,odt} works a= s well (via hyperref). > So I was going to suggest to set title tag to empty string "" or something > generic like "HTML". I don't think I would use the title:nil option. You can do this by setting title to an empty quote and Org will export it, but you produce invalid HTML. It=E2=80=99s actually a bug in ox-html IMO. > But if one needs to hide the title, I think it should not leak out of > the Org document. This is inconsistent compared to ox-odt and ox-latex cf. above. While the two are not entire consistent in general, they are consistent in keeping the title as meta data, while not printing it. > That would be fine if that prevents the title from showing up in browser > tabs, etc. It does not. We could change the manual to be more clear about this (it says title "toggle[s] inclusion of title"). Rasmus --=20 History is what should never happen again From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export. Date: Tue, 01 Aug 2017 19:41:15 +0000 Message-ID: References: <71359491574f233bd37d0804042fb701@wilkesley.net> <87ini7d3aj.fsf@gmx.us> <87efsvcz9m.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="f403045fb91437b90e0555b655c4" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcd2o-0001hZ-KP for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 15:41:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcd2n-0007t6-Db for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 15:41:30 -0400 Received: from mail-lf0-x22a.google.com ([2a00:1450:4010:c07::22a]:34151) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dcd2n-0007qs-1p for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 15:41:29 -0400 Received: by mail-lf0-x22a.google.com with SMTP id g25so11317171lfh.1 for ; Tue, 01 Aug 2017 12:41:27 -0700 (PDT) In-Reply-To: <87efsvcz9m.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 --f403045fb91437b90e0555b655c4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Rasmus, Your patch to fix printing of h1 title when :with-title is nil looks good. More comments below. On Tue, Aug 1, 2017 at 7:18 AM Rasmus wrote: > Yes, but that=E2=80=99s a feature. It=E2=80=99s how ox-{latex,odt} works= as well (via > hyperref). > OK, I agree that the title being made blank not be tied with `:with-title`. > > So I was going to suggest to set title tag to empty string "" or > something > > generic like "HTML". I don't think I would use the title:nil option. > > You can do this by setting title to an empty quote and Org will export it= , > but you produce invalid HTML. It=E2=80=99s actually a bug in ox-html IMO= . > Here is my attempt to fix it (below is a whitespace ignored diff): diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 43e4ef8d48..25a41e1dc4 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -1812,11 +1812,14 @@ INFO is a plist used as a communication channel." (defun org-html--build-meta-info (info) "Return meta tags for exported document. INFO is a plist used as a communication channel." - (let ((protect-string + (let* ((protect-string (lambda (str) (replace-regexp-in-string "\"" """ (org-html-encode-plain-text str)))) (title (org-export-data (plist-get info :title) info)) + ;; Set title to an invisible character instead of leaving it + ;; empty, which is invalid. + (title (if (org-string-nw-p title) title "‎")) (author (and (plist-get info :with-author) (let ((auth (plist-get info :author))) (and auth Credit: https://stackoverflow.com/questions/23556255/how-can-i-have-a-blank-title-p= age#comment67991763_23558385 With above, a "blank" title will also result in a valid HTML, correct? --=20 Kaushal Modi --f403045fb91437b90e0555b655c4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Rasmus,

<= /div>
Your patch to fix printing of h1 title when :with-title is nil lo= oks good.

More comments below.

<= /div>
On Tue, Aug 1, 2017 at 7:18 AM Rasmus <rasmus@gmx.us> wrote:
Yes, but that=E2=80=99s a feature.=C2=A0 It=E2=80=99s how o= x-{latex,odt} works as well (via
hyperref).

OK, I agree that the title b= eing made blank not be tied with `:with-title`.
=C2=A0
> So I was going to suggest to set title tag t= o empty string "" or something
> generic like "HTML". I don't think I would use the title= :nil option.

You can do this by setting title to an empty quote and Org will export it,<= br> but you produce invalid HTML.=C2=A0 It=E2=80=99s actually a bug in ox-html = IMO.

Here is my attempt to fix it (belo= w is a whitespace ignored diff):

diff --git a= /lisp/ox-html.el b/lisp/ox-html.el
index 43e4ef8d48..25a41e1dc4 1= 00644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
=
@@ -1812,11 +1812,14 @@ INFO is a plist used as a communication channe= l."
=C2=A0(defun org-html--build-meta-info (info)
= =C2=A0 =C2=A0"Return meta tags for exported document.
=C2=A0= INFO is a plist used as a communication channel."
- =C2=A0(l= et ((protect-string
+ =C2=A0(let* ((protect-string
=C2= =A0 =C2=A0(lambda (str)
= =C2=A0 =C2=A0 =C2=A0(replace-regexp= -in-string
=C2=A0 =C2=A0 = =C2=A0 "\"" "&quot;" (org-html-encode-plain-te= xt str))))
=C2=A0 (title = (org-export-data (plist-get info :title) info))
+ ;; Set title to an invisible character instead of = leaving it
+ ;; empty, wh= ich is invalid.
+ (title = (if (org-string-nw-p title) title "&lrm;"))=C2=A0
= =C2=A0 (author (and (plist-get info= :with-author)
=C2=A0 = =C2=A0 =C2=A0 =C2=A0(let ((auth (plist-get info :author)))
=C2=A0= (and auth


With above, a "blank"= ; title will also result in a valid HTML, correct?


--

Kaushal Modi

--f403045fb91437b90e0555b655c4-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export. Date: Tue, 01 Aug 2017 22:48:08 +0200 Message-ID: <87o9rzaubb.fsf@gmx.us> References: <71359491574f233bd37d0804042fb701@wilkesley.net> <87ini7d3aj.fsf@gmx.us> <87efsvcz9m.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dce5R-0004Un-D0 for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 16:48:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dce5O-0007f8-9M for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 16:48:17 -0400 Received: from mout.gmx.net ([212.227.17.21]:62253) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dce5N-0007d1-Uh for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 16:48:14 -0400 In-Reply-To: (Kaushal Modi's message of "Tue, 01 Aug 2017 19:41:15 +0000") 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: kaushal.modi@gmail.com Cc: emacs-orgmode@gnu.org Hi Kaushal, Kaushal Modi writes: > Your patch to fix printing of h1 title when :with-title is nil looks good. > > More comments below. OK I=E2=80=99ll push it then.=20 > Here is my attempt to fix it (below is a whitespace ignored diff): Thanks for looking into this. That hack really leaves the title on the tabs completely blank! I=E2=80=99ve never seen anything like it. It=E2=80= =99s in line with other exporters, so on that front it=E2=80=99s fine. I do wonder if i= t=E2=80=99s the right thing to do. When the title is blank Firefox (and I assume other browsers) show the path. With &lrm it=E2=80=99s completely blank. I am fine with this approach, but I=E2=80=99m not particularly fond about h= ow it looks in Firefox and Chromium... > diff --git a/lisp/ox-html.el b/lisp/ox-html.el > index 43e4ef8d48..25a41e1dc4 100644 > --- a/lisp/ox-html.el > +++ b/lisp/ox-html.el > @@ -1812,11 +1812,14 @@ INFO is a plist used as a communication channel." > (defun org-html--build-meta-info (info) > "Return meta tags for exported document. > INFO is a plist used as a communication channel." > - (let ((protect-string > + (let* ((protect-string > (lambda (str) > (replace-regexp-in-string > "\"" """ (org-html-encode-plain-text str)))) > (title (org-export-data (plist-get info :title) info)) Perhaps this would be simpler? (or (org-string-nw-p (org-export-data (plist-get info :title) info)) "&= lrm;") > Credit: > https://stackoverflow.com/questions/23556255/how-can-i-have-a-blank-title= -page#comment67991763_23558385 > > With above, a "blank" title will also result in a valid HTML, correct? It is indeed valid according to the validator. Thanks, Rasmus --=20 Summon the Mothership! From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export. Date: Tue, 01 Aug 2017 20:59:11 +0000 Message-ID: References: <71359491574f233bd37d0804042fb701@wilkesley.net> <87ini7d3aj.fsf@gmx.us> <87efsvcz9m.fsf@gmx.us> <87o9rzaubb.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114205e4ec30700555b76b30" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dceGC-0008R0-Tg for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 16:59:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dceGB-00017d-Ev for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 16:59:24 -0400 Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]:37399) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dceGB-00016p-3U for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 16:59:23 -0400 Received: by mail-lf0-x22f.google.com with SMTP id m86so11976142lfi.4 for ; Tue, 01 Aug 2017 13:59:22 -0700 (PDT) In-Reply-To: <87o9rzaubb.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 --001a114205e4ec30700555b76b30 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Aug 1, 2017 at 4:48 PM Rasmus wrote: > Thanks for looking into this. That hack really leaves the title on the > tabs completely blank! That was the idea.. If someone sets "#+TITLE:", they expect *no* title :) > I=E2=80=99ve never seen anything like it. It=E2=80=99s in line > with other exporters, so on that front it=E2=80=99s fine. I do wonder if= it=E2=80=99s the > right thing to do. When the title is blank Firefox (and I assume other > browsers) show the path. With &lrm it=E2=80=99s completely blank. > I liked seeing that was possible. > Perhaps this would be simpler? > > (or (org-string-nw-p (org-export-data (plist-get info :title) info)) > "‎") > Of course. I thought I was missing out on something. Thanks. > > > Credit: > > > https://stackoverflow.com/questions/23556255/how-can-i-have-a-blank-title= -page#comment67991763_23558385 > > > > With above, a "blank" title will also result in a valid HTML, correct? > > It is indeed valid according to the validator. > Thanks for checking. The validator (the default one in org-html-postamble) never worked for me, probably because of something being blocked at work.. I get this when I click the validator link: =3D=3D=3D=3D=3D Sorry! This document cannot be checked. No Referer header found! You have requested we check the referring page, but your browser did not send the HTTP "Referer" header field. This can be for several reasons, but most commonly it is because your browser does not know about this header, has been configured not to send one, transferred the referring document over a secure protocol such as https but is accessing the validator over ordinary non-secure http, or is behind a proxy or firewall that strips it out of the request before it reaches us. This is not an error in the referring page! =3D=3D=3D=3D=3D Being able to set the title to blank is really cool. I have never needed to do that. But if someone (OP? OP's list email bounces back, so assuming they are subscribed to this ML) wants that, we now know how. --=20 Kaushal Modi --001a114205e4ec30700555b76b30 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Aug 1,= 2017 at 4:48 PM Rasmus <rasmus@gmx.us<= /a>> wrote:
Thanks for looking i= nto this.=C2=A0 That hack really leaves the title on the
tabs completely blank!=C2=A0

That was the = idea.. If someone sets "#+TITLE:", they expect *no* title :)
=C2=A0
I=E2=80=99ve never seen an= ything like it.=C2=A0 It=E2=80=99s in line
with other exporters, so on that front it=E2=80=99s fine.=C2=A0 I do wonder= if it=E2=80=99s the
right thing to do.=C2=A0 When the title is blank Firefox (and I assume othe= r
browsers) show the path.=C2=A0 With &lrm it=E2=80=99s completely blank.=

I liked seeing that was possible.
=C2=A0
Perhaps this would be simp= ler?

=C2=A0 =C2=A0 (or (org-string-nw-p (org-export-data (plist-get info :title)= info)) "&lrm;")

Of cours= e. I thought I was missing out on something. Thanks.
=C2=A0
=

> Credit:
>
https://stackoverflow.com/questions/23556255/how-can-i-have-a-blank= -title-page#comment67991763_23558385
>
> With above, a "blank" title will also result in a valid HTML= , correct?

It is indeed valid according to the validator.

Thanks for checking. The validator (the default one in org-html-pos= tamble) never worked for me, probably because of something being blocked at= work.. I get this when I click the validator link:

=3D=3D=3D=3D=3D
Sorry! This document cannot be checked.
No Referer header found!

You have requeste= d we check the referring page, but your browser did not send the HTTP "= ;Referer" header field. This can be for several reasons, but most comm= only it is because your browser does not know about this header, has been c= onfigured not to send one, transferred the referring document over a secure= protocol such as https but is accessing the validator over ordinary non-se= cure http, or is behind a proxy or firewall that strips it out of the reque= st before it reaches us.

This is not an error in t= he referring page!
=3D=3D=3D=3D=3D

Being able to set the title to blank is really cool. I have never needed t= o do that. But if someone (OP? OP's list email bounces back, so assumin= g they are subscribed to this ML) wants that, we now know how.
<= /div>
--

Kaushal Modi

--001a114205e4ec30700555b76b30-- 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 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 08:03:45 +1000 Message-ID: <871sovaqta.fsf@gmail.com> References: <71359491574f233bd37d0804042fb701@wilkesley.net> <87ini7d3aj.fsf@gmx.us> <87efsvcz9m.fsf@gmx.us> <87o9rzaubb.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]:43488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcfGb-0006Pe-JO for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 18:03:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcfGa-0006AH-Dl for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 18:03:53 -0400 Received: from mail-pg0-x22f.google.com ([2607:f8b0:400e:c05::22f]:33010) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dcfGa-00069u-8N for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 18:03:52 -0400 Received: by mail-pg0-x22f.google.com with SMTP id c14so13219715pgn.0 for ; Tue, 01 Aug 2017 15:03:52 -0700 (PDT) In-reply-to: <87o9rzaubb.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, kaushal.modi@gmail.com While I totally agree with your sentiments, I don't think we should worry about how/what the browser renders. We should ensure valid HTML and leave how this is interpreted/rendered to the browsers. Alternative is we jump through lots of hoops trying to get something which looks reasonable in all browsers and then find it all gets broken after next browser version is released. I do think the idea of clarifying and perhaps making suggestions in the manual is a good approach - let the author have as much control as possible. Tim Rasmus writes: > Hi Kaushal, > > Kaushal Modi writes: > >> Your patch to fix printing of h1 title when :with-title is nil looks good. >> >> More comments below. > > OK I’ll push it then. > >> Here is my attempt to fix it (below is a whitespace ignored diff): > > Thanks for looking into this. That hack really leaves the title on the > tabs completely blank! I’ve never seen anything like it. It’s in line > with other exporters, so on that front it’s fine. I do wonder if it’s the > right thing to do. When the title is blank Firefox (and I assume other > browsers) show the path. With &lrm it’s completely blank. > > I am fine with this approach, but I’m not particularly fond about how it > looks in Firefox and Chromium... > >> diff --git a/lisp/ox-html.el b/lisp/ox-html.el >> index 43e4ef8d48..25a41e1dc4 100644 >> --- a/lisp/ox-html.el >> +++ b/lisp/ox-html.el >> @@ -1812,11 +1812,14 @@ INFO is a plist used as a communication channel." >> (defun org-html--build-meta-info (info) >> "Return meta tags for exported document. >> INFO is a plist used as a communication channel." >> - (let ((protect-string >> + (let* ((protect-string >> (lambda (str) >> (replace-regexp-in-string >> "\"" """ (org-html-encode-plain-text str)))) >> (title (org-export-data (plist-get info :title) info)) > > Perhaps this would be simpler? > > (or (org-string-nw-p (org-export-data (plist-get info :title) info)) "‎") > >> Credit: >> https://stackoverflow.com/questions/23556255/how-can-i-have-a-blank-title-page#comment67991763_23558385 >> >> With above, a "blank" title will also result in a valid HTML, correct? > > It is indeed valid according to the validator. > > Thanks, > Rasmus -- Tim Cross From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export. Date: Wed, 09 Aug 2017 11:56:46 +0200 Message-ID: <87a839awtd.fsf@gmx.us> References: <71359491574f233bd37d0804042fb701@wilkesley.net> <87ini7d3aj.fsf@gmx.us> <87efsvcz9m.fsf@gmx.us> <87o9rzaubb.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]:41563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfNja-0007rR-Ku for emacs-orgmode@gnu.org; Wed, 09 Aug 2017 05:57:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfNjW-0000X0-IW for emacs-orgmode@gnu.org; Wed, 09 Aug 2017 05:57:02 -0400 Received: from [195.159.176.226] (port=36075 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfNjW-0000Wa-CA for emacs-orgmode@gnu.org; Wed, 09 Aug 2017 05:56:58 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dfNjL-0001YY-EH for emacs-orgmode@gnu.org; Wed, 09 Aug 2017 11:56:47 +0200 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: emacs-orgmode@gnu.org Hi, Kaushal Modi writes: > Thanks for checking. The validator (the default one in org-html-postamble) > never worked for me, probably because of something being blocked at work.. > I get this when I click the validator link: > > ===== > Sorry! This document cannot be checked. > No Referer header found! > > You have requested we check the referring page, but your browser did not > send the HTTP "Referer" header field. This can be for several reasons, but > most commonly it is because your browser does not know about this header, > has been configured not to send one, transferred the referring document > over a secure protocol such as https but is accessing the validator over > ordinary non-secure http, or is behind a proxy or firewall that strips it > out of the request before it reaches us. > > This is not an error in the referring page! > ===== There’s definitely some sort of issue... I guess this is for a local file? I guess it needs to be publicly available. But it doesn’t seem to work all the time even for public pages. Using the following example, it only works from the http version, not the https version. https://pages.gitlab.io/org-mode/ http://pages.gitlab.io/org-mode/ Rasmus -- Send from my Emacs From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export. Date: Wed, 09 Aug 2017 12:38:06 +0200 Message-ID: <8760dxauwh.fsf@gmx.us> References: <71359491574f233bd37d0804042fb701@wilkesley.net> <87ini7d3aj.fsf@gmx.us> <87efsvcz9m.fsf@gmx.us> <87o9rzaubb.fsf@gmx.us> <87a839awtd.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]:54797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfONj-0007cn-AA for emacs-orgmode@gnu.org; Wed, 09 Aug 2017 06:38:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfONf-00060c-3s for emacs-orgmode@gnu.org; Wed, 09 Aug 2017 06:38:31 -0400 Received: from [195.159.176.226] (port=38655 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfONe-00060D-US for emacs-orgmode@gnu.org; Wed, 09 Aug 2017 06:38:27 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dfONP-00087z-0M for emacs-orgmode@gnu.org; Wed, 09 Aug 2017 12:38:11 +0200 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: emacs-orgmode@gnu.org Rasmus writes: > Hi, > > Kaushal Modi writes: > >> Thanks for checking. The validator (the default one in org-html-postamble) >> never worked for me, probably because of something being blocked at work.. >> I get this when I click the validator link: >> >> ===== >> Sorry! This document cannot be checked. >> No Referer header found! >> >> You have requested we check the referring page, but your browser did not >> send the HTTP "Referer" header field. This can be for several reasons, but >> most commonly it is because your browser does not know about this header, >> has been configured not to send one, transferred the referring document >> over a secure protocol such as https but is accessing the validator over >> ordinary non-secure http, or is behind a proxy or firewall that strips it >> out of the request before it reaches us. >> >> This is not an error in the referring page! >> ===== > > There’s definitely some sort of issue... > > I guess this is for a local file? I guess it needs to be publicly > available. But it doesn’t seem to work all the time even for public > pages. > > Using the following example, it only works from the http version, not the > https version. Https pages not working is a known "bug" cf. https://validator.w3.org/docs/help.html#faq-referer If a JS solution is OK, we could do something like this: Validate This would work with public https pages if JS is supported. See: https://validator.w3.org/favelets.html https://lists.w3.org/Archives/Public/www-validator/2005Mar/0011.html I have not found a way to send the raw source code via an url for local files. Rasmus -- Dobbelt-A From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export. Date: Mon, 14 Aug 2017 20:15:25 +0000 Message-ID: References: <71359491574f233bd37d0804042fb701@wilkesley.net> <87ini7d3aj.fsf@gmx.us> <87efsvcz9m.fsf@gmx.us> <87o9rzaubb.fsf@gmx.us> <87a839awtd.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114dca3c63ca400556bc53e4" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dhLly-0006Tm-MK for emacs-orgmode@gnu.org; Mon, 14 Aug 2017 16:15:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dhLlx-0006qn-Jn for emacs-orgmode@gnu.org; Mon, 14 Aug 2017 16:15:38 -0400 Received: from mail-yw0-x22a.google.com ([2607:f8b0:4002:c05::22a]:33016) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dhLlx-0006qf-Eu for emacs-orgmode@gnu.org; Mon, 14 Aug 2017 16:15:37 -0400 Received: by mail-yw0-x22a.google.com with SMTP id p68so61617521ywg.0 for ; Mon, 14 Aug 2017 13:15:37 -0700 (PDT) In-Reply-To: <87a839awtd.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 , emacs-orgmode@gnu.org --001a114dca3c63ca400556bc53e4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Aug 9, 2017 at 5:58 AM Rasmus wrote: > There=E2=80=99s definitely some sort of issue... > > I guess this is for a local file? Correct. I was testing it out only on an HTML file (local) exported from org. > I guess it needs to be publicly > available. But it doesn=E2=80=99t seem to work all the time even for pub= lic > pages. > > Using the following example, it only works from the http version, not the > https version. > > https://pages.gitlab.io/org-mode/ > http://pages.gitlab.io/org-mode/ OK. Thanks for the info. About the fix for blank titles, I just pushed it to master ( http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=3Dc8ade76ca2d579e9415cb= 3588605a6c98803f413 ). --=20 Kaushal Modi --001a114dca3c63ca400556bc53e4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
--

Kaushal Modi

--001a114dca3c63ca400556bc53e4--