ietf-tools / xml2rfc

Generate RFCs and IETF drafts from document source in XML according to the IETF xml2rfc v2 and v3 vocabularies
https://ietf-tools.github.io/xml2rfc/
BSD 3-Clause "New" or "Revised" License
69 stars 38 forks source link

HTML output: capture date of XML file prep and date of HTML rendering #1032

Open ajeanmahoney opened 1 year ago

ajeanmahoney commented 1 year ago

Description

Currently the HTML output captures the version of xml2rfc in the <meta> element, e.g., <meta content="xml2rfc 3.17.4" name="generator"> and also in a comment:

<!-- Generator version information:
  xml2rfc 3.17.4
    Python 3.9.15
    ConfigArgParse 1.5.3
    google-i18n-address 3.0.0
    intervaltree 3.1.0
    Jinja2 3.1.2
    lxml 4.9.0
    platformdirs 3.8.0
    pycountry 22.3.5
    PyYAML 6.0
    requests 2.28.0
    setuptools 44.1.1
    six 1.16.0
    wcwidth 0.2.5
    weasyprint 56.1
-->

When the HTML output is created, it would be good to also have a timestamp of publication (that is, propagate the timestamp from the prepTime attribute found in the XML file) and a timestamp that captures when the HTML was rendered. If the HTML is then rerendered in the future, then these two timestamps will capture that info (that is, the publication timestamp will be older than the rendering timestamp). See the RPAT meeting notes.

Code of Conduct

kesara commented 1 year ago

With the change proposed in #1033, xml2rfc will add a new meta tag with name created. This content for the meta tag will have the date & time (with UTC timezone) in ISO format. Example:

    <meta content="2023-09-21T10:47:04.440964+00:00" name="created">
kesara commented 1 year ago

I've updated the created timestamp to show hours and minutes with Z instead of +00:00. Example:

<meta content="2023-09-22T11:16Z" name="created">
kesara commented 1 year ago

@ajeanmahoney, Are you proposing to have two new meta tags with this request? i.e. publication date (derived from prepTime) and HTML created date.

Do we need to include time as well?

Note that the current prepTime includes time but not the timezone.

ajeanmahoney commented 1 year ago

Yes, two new meta tags, which don't need HH:MM info:

rjsparks commented 1 year ago

If we have the time, why not include it?

ajeanmahoney commented 1 year ago

Mainly it's an accuracy versus precision thing. There is a nonzero span of time between generating the document and making it publicly available. It's why RFCs currently show only the month and year in the doc header. In these meta tags, it doesn't matter as much, but if we were to show this information in the document itself, say in a colophon at the end of the doc, day resolution should be sufficient for the reader.