mdn - speced/respec GitHub Wiki

mdn

Type: boolean | string | MdnOptions Default: undefined

Adds MDN browser compatibility annotations to relevant sections of the specification. Annotations are shown as expandable panels in the right margin, sourced from MDN's browser-compat-data via the mdn-spec-links project.

Basic usage

var respecConfig = {
  shortName: "payment-request",
  mdn: true,
};
var respecConfig = {
  mdn: "payment-request",
};

With options

var respecConfig = {
  mdn: {
    key: "payment-request",
    maxAge: 3600000, // 1 hour cache
  },
};

Options

Option Type Default Description
key string shortName Key used to look up MDN data. Browse keys at SPECMAP.json.
baseJsonPath string https://w3c.github.io/mdn-spec-links/ Custom base URL for MDN spec links data
maxAge number 86400000 Cache duration in milliseconds (default: 24 hours)

Notes

  • MDN annotations are collapsed by default — click to expand a panel showing browser support and a link to MDN
  • Each panel shows an engine support summary (✅ all engines / 🚫 limited) and per-browser version data
  • Annotations appear next to relevant section IDs that match MDN's data — not all sections will have annotations
  • To find the right key, look up your spec URL in SPECMAP.json