-
-
Notifications
You must be signed in to change notification settings - Fork 421
xref
Type: boolean | string | string[] | XrefOptions
Default: true (W3C profile)
Enables automatic cross-reference linking. When a term is wrapped in [= =] or {{ }} shorthand syntax, ReSpec automatically links it to the defining specification.
var respecConfig = {
xref: "web-platform",
};Then write terms naturally — ReSpec links them automatically:
<p>
[=Queue a task=] to [=fire an event=] named "fetch"
at the {{Window}} object.
</p>Understanding the pipeline helps when terms aren't found:
Your spec writes [=fetch=]
↓
ReSpec queries the xref service (respec.org/xref)
↓
Service looks up "fetch" in the WebRef database
↓
WebRef is populated by Reffy, which crawls published specs every 6 hours
↓
Reffy finds terms marked with <dfn data-export> in published specs
↓
Term found → generates <a href="https://fetch.spec.whatwg.org/#concept-fetch">fetch</a>
Term not found → ReSpec shows a red error banner
For a term to be findable via xref, ALL of these must be true:
- The defining spec is listed in browser-specs
- The defining spec is published (Editor's Drafts are crawled; unpublished local files are not)
- The
<dfn>in the defining spec hasdata-exportorclass="export" - Reffy has crawled it (within the last 6 hours for EDs; weekly for TR snapshots)
If a term isn't in the database, ask the defining spec's editors to add data-export. See data-export.
var respecConfig = {
xref: true,
};var respecConfig = {
xref: "web-platform",
};The "web-platform" profile includes: HTML, INFRA, URL, WEBIDL, DOM, FETCH.
var respecConfig = {
xref: ["FETCH", "DOM"],
};var respecConfig = {
xref: {
profile: "web-platform",
specs: ["PERMISSIONS", "SCREEN-WAKE-LOCK"],
},
};| Option | Type | Description |
|---|---|---|
profile |
string |
Pre-defined profile name (e.g. "web-platform") |
specs |
string[] |
Additional spec shortnames to include in lookups |
url |
string |
Custom xref API URL (advanced — not normally needed) |
- When both
profileandspecsare set, both sets of specs are used for disambiguation - To manually link to a specific anchor in another spec, use
data-cite - Browse and test xref lookups at respec.org/xref
- See Auto-linking external references for disambiguation and advanced usage
💖 Support ReSpec by becoming a sponsor via Open Collective. 💖
✨ View rendered version of this documentation at https://respec.org/docs/ ✨
- Getting Started
- How Do I…
- Spec Editor's Guide
- Writing Algorithms
- WebIDL Guide
- Configuring ReSpec
- Developers Guide
- Shorthands
- addSectionLinks
- authors
- caniuse
- edDraftURI
- editors
- format (markdown)
- formerEditors
- github
- highlightVars
- isPreview
- license
- lint
- localBiblio
- logos
- maxTocLevel
- mdn
- modificationDate
- monetization
- noTOC
- otherLinks
- pluralize
- postProcess
- preProcess
- previousDiffURI
- previousMaturity
- previousPublishDate
- prevRecShortname
- prevRecURI
-
processVersion(Removed) - publishDate
- shortName
- specStatus
- subjectPrefix
- subtitle
- testSuiteURI
- xref
- additionalCopyrightHolders
-
addPatentNote(Removed) - alternateFormats
- canonicalURI
- charterDisclosureURI
- copyrightStart
- crEnd
- dark mode
- doJsonLd
- errata
- group
- implementationReportURI
- level
- noRecTrack
- prevED
- prEnd
- submissionCommentNumber
-
wg(Deprecated — usegroup) -
wgId(Deprecated — usegroup) -
wgPatentURI(Deprecated — usegroup) -
wgPublicList(Deprecated — usegroup) -
wgURI(Deprecated — usegroup)
a11ycheck-charsetcheck-internal-slotscheck-punctuationinformative-dfnlocal-refs-existno-captionless-tablesno-headingless-sectionsno-http-propsno-link-warningsno-unused-dfnsno-unused-varsprivsec-sectionwpt-tests-exist
Handled by ReSpec for you.
- conformance
- idl-index
- index
- issue-summary
- references
- tof (Table of Figures)
- data-abbr
- data-cite
- data-dfn-for
- data-dfn-type
- data-export
- data-format
- data-include
- data-include-format
- data-include-replace
- data-link-for
- data-link-type
- data-local-lt
- data-lt
- data-lt-no-plural
- data-lt-noDefault
- data-max-toc
- data-number
- data-oninclude
- data-sort
- data-tests
-
data-transform(Deprecated) - data-type
- dir
- lang