Lukas Epple <em...@lukasepple.de> writes: > the attached patches implement the feature I proposed in this thread > partially: For `org-html-doctype' "html5" and `org-html-html5-fancy', > use the semantic <time> element to wrap timestamps and populate its > datetime attribute with a valid date/date and time string according to > the HTML Standard. The same should also be done for the duration of > clock elements, but I think this is good point to get some feedback on > my first change.
Thanks for the patch! >> Just make the timestamp format customizeable. >> As for different timezone settings - Org implicitly uses current >> timezone, so it is not an error to include it. >> >> If you make the format customizeable, do not put timezone it in by >> default, and leave the version with timezone as one of the available >> custom options, it should be good enough. > I ended up doing just that via > `org-html-datetime-attribute-date-timestamp-format' and > `org-html-datetime-attribute-full-timestamp-format'. I haven't put much > time into naming, so they are super clunky and I would love some > suggestions here. Also I wasn't sure what Emacs version would be correct > to put in :version, so that's still missing. You should not use :version. Those :versions tags are obsolete in Org codebase (they are just for truly built-in Emacs source code, not for externally maintained packages) and are being slowly removed. See https://orgmode.org/worg/org-maintenance.html#minor-major-releases Rather than creating two distinct variables, I suggest keeping one, similar to `org-timestamp-formats': say, org-html-datetime-formats. > PS: My FSF Copyright Assignment paperwork has been completed. Yup. I confirm. > Subject: [PATCH 5/5] lisp/ox-html.el: use time element for timestamps in fancy > html5 > > * ox-html.el (org-html--format-timestamp): use time html element and its > datetime attribute when org-html--html5-fancy-p. Please start sentences from capital letter and `quote' Elisp symbols. See https://orgmode.org/worg/org-contribute.html#commit-messages > +*** Fancy HTML5 export uses ~<time>~ element for timestamps > +Previously, timestamps would always be rendered inside a ~<span > +class="timestamp">~. If both ~org-html-doctype~ is ~html5~ and *Now, if both ... > +~org-html-html5-fancy~ is enabled, org will now use the semantically > +appropriate ~<time>~ element. It also will use the ~timestamp~ class, for <time ...> tag, right? > + (should (= 1 (how-many (rx-to-string s))))) Can simply do (search-forward s nil t) > +(defun org-html--format-timestamp (timestamp info) > + "Format given TIMESTAMP for inclusion in an HTML document. > +INFO is a plist used as a communication channel. Formatted timestamp > +will be wrapped in an element with class timestamp." > + (replace-regexp-in-string > + "--" > + "–" ; EN DASH What is the motivation behind changing -- to EN DASH? -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>