Re: ox-html: Bug or feature for export of title and meta information?
Hi there! On 2020-02-17, at 10:47, Nicolas Goaziou wrote: > Jens Lechtenboerger writes: >> Which “non exportable objects” can be skipped by that function (as >> mentioned in a comment in org-html--build-meta-info)? Should they also >> be skipped for description or title? > > That non-exportable part is confusing. I think > > (org-element-interpret-data auth) > > is sufficient. I pushed a change in that direction. Thank you! The function org-element-interpret-data seems to return the empty string for nil. Is that by contract or accident? In the former case, maybe use (org-element-interpret-data (plist-get info :author)) instead of the let statement? What do you think about applying org-element-interpret-data (instead of org-export-data) when let-binding title, like the following? (org-html-encode-plain-text (org-element-interpret-data (plist-get info :title))) As far as I can tell, this would create valid (X)HTML. Best wishes Jens
Re: ox-html: Bug or feature for export of title and meta information?
Hello, Jens Lechtenboerger writes: > Based on the treatment of meta elements for author and description > in that function, alternatives might use org-element-interpret-data > (author) or not (description). I do not understand the role of > org-element-interpret-data to generate author information. `org-element-interpret-data' means: "down with HTML, go back to Org syntax". IOW, it mean the author is supplied as-is. > Which “non exportable objects” can be skipped by that function (as > mentioned in a comment in org-html--build-meta-info)? Should they also > be skipped for description or title? That non-exportable part is confusing. I think (org-element-interpret-data auth) is sufficient. I pushed a change in that direction. Regards, -- Nicolas Goaziou
Re: ox-html: Bug or feature for export of title and meta information?
Hi there! On 2020-02-15, at 15:02, Nicolas Goaziou wrote: > Jens Lechtenboerger writes: > >> the W3C Markup Validator [1] disagrees with this output from >> ox-html (which I reduced to the essential parts): > > OK. I was talking about the Org syntax. I misread your initial report. > > I won't comment about the generated HTML. If needed, the HTML exporter > can prevent parsing TITLE keyword. I do not know what is needed. Function org-html--build-meta-info should return valid XHTML (also in case of HTML5, I believe that Org syntax is preferable over ignored [1] HTML tags). Based on the treatment of meta elements for author and description in that function, alternatives might use org-element-interpret-data (author) or not (description). I do not understand the role of org-element-interpret-data to generate author information. Which “non exportable objects” can be skipped by that function (as mentioned in a comment in org-html--build-meta-info)? Should they also be skipped for description or title? Best wishes Jens [1] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
Re: ox-html: Bug or feature for export of title and meta information?
Hi Nicolas, Nicolas Goaziou writes: > I don't think so. It is a constant, which may only matter when you write > an export-backend. Its value is not even particularly important since > any back-end can ignore it. Only its syntax really matters, as pointed > out in, e.g., `org-export-define-derived-backend' docstring. To sum it > up, I see it is an implementation detail. I see, thanks. > The manual might, however, be more rigorous about what keywords each > back-end really interprets. I don't know how, and where, it could fit, > tho. I guess a tutorial on how to write a new export backend will give us a hint on where and how to mention this. I am not sure it belongs to the manual. Best, -- Bastien
Re: ox-html: Bug or feature for export of title and meta information?
Hello, Bastien writes: > I see org-export-options-alist is not mentioned in the manual - would > it be worth mentioning it in the "Adding Export Back-ends" section? I don't think so. It is a constant, which may only matter when you write an export-backend. Its value is not even particularly important since any back-end can ignore it. Only its syntax really matters, as pointed out in, e.g., `org-export-define-derived-backend' docstring. To sum it up, I see it is an implementation detail. The manual might, however, be more rigorous about what keywords each back-end really interprets. I don't know how, and where, it could fit, tho. Regards, -- Nicolas Goaziou
Re: ox-html: Bug or feature for export of title and meta information?
Hello, Jens Lechtenboerger writes: > the W3C Markup Validator [1] disagrees with this output from > ox-html (which I reduced to the essential parts): OK. I was talking about the Org syntax. I misread your initial report. I won't comment about the generated HTML. If needed, the HTML exporter can prevent parsing TITLE keyword. Regards, -- Nicolas Goaziou
Re: ox-html: Bug or feature for export of title and meta information?
On 2020-02-14, at 20:31, Nicolas Goaziou wrote: > Hello, > > Jens Lechtenboerger writes: > >> 1. Export to HTML when the title contains markup, say this one: >> >> #+TITLE: This does *not* work > > What does not work? > >> The HTML title element contains a nested b element, which is >> invalid as only text is allowed. > > Who said that? The above is perfectly valid. Good morning (over here), the W3C Markup Validator [1] disagrees with this output from ox-html (which I reduced to the essential parts): #+begin_src html http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;> http://www.w3.org/1999/xhtml; lang="en" xml:lang="en"> This does not work #+end_src Best wishes Jens [1] https://validator.w3.org/#validate_by_input
Re: ox-html: Bug or feature for export of title and meta information?
Hi Nicolas, Nicolas Goaziou writes: > This doesn't mean the manual cannot be improved, of course. Improvements > are welcome in that area. I see org-export-options-alist is not mentioned in the manual - would it be worth mentioning it in the "Adding Export Back-ends" section? -- Bastien
Re: ox-html: Bug or feature for export of title and meta information?
Completing myself, Nicolas Goaziou writes: > General export rules are described in ox.el (org-export-options-alist), > then each export back-end define its own specificities (look at the > back-end definition). This doesn't mean the manual cannot be improved, of course. Improvements are welcome in that area.
Re: ox-html: Bug or feature for export of title and meta information?
Hello, Jens Lechtenboerger writes: > 1. Export to HTML when the title contains markup, say this one: > > #+TITLE: This does *not* work What does not work? > The HTML title element contains a nested b element, which is > invalid as only text is allowed. Who said that? The above is perfectly valid. > 2. The documentation does not explain which headers are exported how > to HTML. Some keywords have are more important than others, since they have a special meaning during export, e.g., TITLE vs. RANDOM_FOO. General export rules are described in ox.el (org-export-options-alist), then each export back-end define its own specificities (look at the back-end definition). Regards, -- Nicolas Goaziou
Re: ox-html: Bug or feature for export of title and meta information?
On 2020-02-11, at 09:16, Bastien wrote: > Hi Jens, > > it is difficult to justify existing code, it is easier to answer to > bug reports. If you think there is a bug in this aread, can you tell > what it is? Hi Bastien, many thanks for following up on this! I see two or more bugs: 1. Export to HTML when the title contains markup, say this one: #+TITLE: This does *not* work The HTML title element contains a nested b element, which is invalid as only text is allowed. 2. The documentation does not explain which headers are exported how to HTML. I described different variants in my previous e-mail. I’m not sure whether there was a reason to treat them differently. So, this is at least a bug in the documentation (with potentially more bugs in the code if the current treatment was not desirable). Best wishes Jens
Re: ox-html: Bug or feature for export of title and meta information?
Hi Jens, it is difficult to justify existing code, it is easier to answer to bug reports. If you think there is a bug in this aread, can you tell what it is? https://orgmode.org/org.html#Feedback might help. Thanks! -- Bastien
[O] ox-html: Bug or feature for export of title and meta information?
Hi there, I wonder about the treatment of different pieces of HTML header information in org-html--build-meta-info: Contents for the title element are computed by org-export-data. This interprets Org markup such as italics or hyperlinks although title elements are not allowed to contain the resulting sub-elements. Why is org-export-data applied? Why not produce plain text? Contents for the description and keywords meta attributes are computed with org-html-encode-plain-text and replacement of quotation marks. Seems fine to me. Contents for the author meta attribute are computed with org-element-interpret-data, before org-html-encode-plain-text and quotation mark replacement are applied. How would author information look like that benefits from this more complex treatment (compared to description and keywords)? Thanks Jens