-
-
Notifications
You must be signed in to change notification settings - Fork 420
document.respec
Marcos Caceres edited this page Mar 28, 2026
·
8 revisions
ReSpec adds a respec object to document when it loads. Use it to wait for processing to complete, inspect errors and warnings, or export the processed HTML.
A Promise that resolves when ReSpec finishes all processing (including postProcess functions).
<script>
document.addEventListener("DOMContentLoaded", async () => {
await document.respec.ready;
console.log("Errors:", document.respec.errors);
console.log("Warnings:", document.respec.warnings);
});
</script>An array of errors found during processing.
An array of warnings found during processing.
Each item in errors and warnings has:
| Property | Type | Description |
|---|---|---|
message |
string |
The error/warning message text |
plugin |
string |
Name of the ReSpec plugin that generated it (e.g. "core/xref") |
hint |
string |
Optional suggestion for how to fix it |
title |
string |
Short form of the message (used as element tooltip) |
elements |
HTMLElement[] |
The offending elements in the document, if applicable |
details |
string |
Additional context or explanation |
cause |
object |
The underlying error that caused this one, if any |
The current ReSpec version string (semver, e.g. "35.8.0").
Returns a Promise that resolves with the fully-processed document markup as a string — the same output as "Save as HTML".
<script>
document.addEventListener("DOMContentLoaded", async () => {
await document.respec.ready;
const html = await document.respec.toHTML();
// Send to a server, save to disk, etc.
await fetch("/save", { method: "POST", body: html });
});
</script>- Always
await document.respec.readybefore readingerrors/warnings— the arrays are populated incrementally during processing - The deprecated
document.respecIsReadywas a bare Promise ondocument; the modern form isdocument.respec.ready
💖 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