Skip to content
rfc-workflow Kramdown RFC Mechanics
Login

Kramdown RFC Mechanics

This note captures reusable mechanics for producing Internet-Draft or RFC outputs from kramdown-rfc source. It is intentionally limited to render and validation behavior. Local install steps, package-manager commands, and machine-specific setup belong in project-pack or operator notes, not here.

Scope

Use this note when a workflow produces:

The workflow owns the document content. This note owns the mechanical rules that keep source, rendered output, and validation behavior aligned.

Render pipeline

The toolchain has two stages:

  1. kramdown-rfc converts Markdown source to RFCXML v3.
  2. xml2rfc renders the XML to text or other publishable formats.

Canonical render path:

kramdown-rfc -3 draft.md > draft.xml
xml2rfc --text draft.xml -o draft.txt

Common alternate outputs:

xml2rfc --html draft.xml -o draft.html
xml2rfc --pdf  draft.xml -o draft.pdf

A clean kramdown-rfc run should leave stderr empty. A clean xml2rfc text render typically emits one Created file line. Treat extra stderr lines as warnings or errors that require disposition.

Required source structure

kramdown-rfc source has YAML front matter followed by body sections introduced with --- middle and, when needed, --- back.

Two structural rules matter mechanically:

  1. A blank line must precede every heading. Without the blank line, a heading can render as ordinary paragraph text and later fail at the xml2rfc stage.
  2. A blank line must precede each --- middle and --- back separator. Treat the separators as structural boundaries, not inline text.

Minimal safe shape:

---
title: Example Draft
submissiontype: STREAM-NAME
---

--- middle

# Introduction

Text.

--- back

Front-matter compatibility

Set front-matter fields so the stream and category agree with the intended publication target. Incompatible combinations may render with warnings or be rejected later.

At minimum, make these choices explicit in source:

Do not rely on tool defaults for stream selection.

BCP 14 requirement keywords

When the document uses RFC 2119 or RFC 8174 requirement keywords, include a dedicated Requirements Language section with tagged boilerplate:

## Requirements Language

{::boilerplate bcp14-tagged}

Mechanical rules:

Literal character safety

Markdown and kramdown consume punctuation. Any literal protocol character, metacharacter, or grammar token that must survive into rendered output should appear in code spans, code blocks, or fenced examples.

After each render, verify that:

References and cache behavior

Reference resolution can depend on cached bibxml data and network availability.

Reusable mechanics:

Do not assume a successful render means every reference resolved correctly.

Warning triage

Warnings do not all mean the same thing.

Warnings that usually require action:

Warnings that may be acceptable with explicit disposition:

A workflow should record which warnings were treated as blockers, which were accepted, and why.

Non-ASCII handling

Rendered output may contain non-ASCII characters introduced by source text, references, or boilerplate.

Reusable rules:

Rendered-text-first example validation

Examples are not validated merely because the source Markdown looks correct.

For every public example:

  1. Render the draft.
  2. Extract the example from the rendered public text.
  3. Reconstruct the exact bytes or tokens that the rendered example claims.
  4. Re-run the relevant parser, decoder, comparison, or execution check against that rendered form.
  5. Confirm the rendered example still produces the stated result.

Mechanical risks to check explicitly:

If the source example was correct but the rendered form no longer round-trips, the document is not ready.

Byte-counted or binary payload examples

Any example that embeds a length-counted, opaque, or binary payload needs extra handling.

Mechanical rules:

Publication-service fallback

When a local toolchain is unavailable or a second opinion is needed, the IETF Author Tools service can render and validate kramdown-rfc sources. Treat it as an alternate renderer, not as a replacement for local evidence discipline: the same rendered-text checks still apply.

Reusable verification checklist

Before a draft advances past mechanical validation, confirm:

Escalate when

Stop and escalate when: