User Tools

Site Tools


design:finalizer

THIS PAGE IS NO LONGER IN USE AND IS OUT-OF-DATE.

PLEASE SEE draft-hoffman-rfcv3-preptool INSTEAD

v3 prep tool usage scenarios

The prep tool will have (at least) two settings:

  • Internet-Draft preparation
  • Canonical RFC preparation

There are only a few difference between these two settings. For example, the boilerplate output will be different, as will the date output on the front page.

Note that this only describes what the IETF-sponsored prep tool does. Others might create their own work-alike prep tools for their own formatting needs. However, an output format developer does not not need to change the prep tool in order to create their own formatter: they only need to be able to consume prepared text.

This tool is described as if it is a separate tool so that we can reason about its architectural properties. In actual implementation, it might be a part of a larger suite of functionality.

Internet-Draft submission

When the IETF draft submission tool accepts v3 XML as an input format, the submission tool runs the submitted file through the prep tool. If the tool finds no errors, it keeps two XML files: the submitted file and the prepped file. This prepped file represents a self-contained record of what any external references resolved to at the time of submission. The prepped file is used by the IETF formatters to create outputs such as HTML, PDF, and text (or the tools act in a way indistinguishable from this). The message sent out by the draft submission tool includes a link to the original XML as well as the other outputs, including the prepped XML.

The prepped XML can be used by tools not yet developed to output new formats that have as similar output as possible to the current IETF formatters. For example, if we create a .mobi output renderer later, we can run that renderer on all of the prepped XML that we have saved, ensuring that the content of included external references and all of the part numbers and boilerplate will be the same as what was produced by the previous IETF formatters at the time the document was first uploaded.

Canonical RFC preparation

During AUTH48, the RPC will run the prep tool in canonical RFC preparation mode and make the results available to the authors so they can see what the final output might look like. When the document is done with AUTH48 review, the RPC runs the prep tool in canonical RFC preparation mode one last time, locks down the canonicalized XML, runs the formatters for the non-canonical output, and publishes all of those. It is probably a good idea for the RPC to keep a copy of the input XML file from the various steps of the RFC production process.

Similarly to I-D's, the prepped XML can be used later to re-render the output formats, or to generate new formats.

What the v3 prep tool does

This is a mostly-complete list of what the v3 prep tool does. The steps are in order of processing.

  • Process all <x:include> elements. Note: <x:include>d XML may include more <x:include>s (with relative URLs rooted at the xml:base), set a limit on the depth of recursion.
  • Remove comments
  • If boilerplate exists, produce a scary warning
    • Else, fill in boilerplate text with current values
  • Fill in document publish date
  • Fill in expires date, if in I-D mode
  • Fill in any default values for attributes on elements, except t/@keepWith* and section/@toc
  • If the <workgroup> item doesn't end with “Group”, warn
  • Add slugifiedName to each <name> that does not contain a valid one (generating only valid HTML id's starting with n-)
  • Remove any existing pn attributes
  • Add pn attributes for all parts. Parts are:
    • section: pn='s-1.4.2'
      • except <abstract>, which gets pn='s-abstract'
      • except <note>, which gets pn='s-note-[counter]'
    • table: pn='t-3'
    • figure: pn='f-4'
    • (abstract, note, t, aside, blockquote, li, dt, artwork, sourcecode, references): pn='p-[section]-[counter]'
  • Add start attribute to every <ol> element containing a group that doesn't already have a start.
  • Sort the references, if desired
  • Resolve all <xref> elements
    • Ensure the target is valid
    • Invent text for each element that doesn't have it
  • Process <artwork>
    • if type='svg'
      • If src attribute, inline and remove src, insert xml:base
      • Check SVG schema against our TinySVG profile
    • else if src != data:, turn into data:, insert xml:base
  • Add finalizedTime to attribute to <rfc>.
  • Add a <link> to <rfc> for the DOI, if this is an RFC.
  • Determine all the characters used in the document and fill in “scripts” attribute for <rfc>.
  • Ensure that the output has the “version” attribute of <rfc>, and that it is set to “3”
  • Pretty-format the XML output. Note: Dentin now does an adequate job.
    • This step might be controversial
  • Ensure full compliance to v3 schema, without any deprecated elements or attributes, and error if any issues are found
design/finalizer.txt · Last modified: 2015/05/22 22:07 by paul