Skip to content
Marcos Cáceres edited this page May 24, 2022 · 5 revisions

document.respec

When ReSpec is loaded, it immediately adds a respec object to the document object which contains following properties:

document.respec.ready

This property returns a Promise, which resolves when ReSpec finishes all its processing. This promise is useful if you need to be notified when ReSpec has finished doing its work - and you want to do some additional work.

The following example shows how to use document.respec.ready.

<script>
  // Wait until resources have loaded, including ReSpec
  document.addEventListener("load", function () {
    document.respec.ready.then(function () {
      // Do things
    });
  });
</script>

document.respec.errors {#document.respec.errors}

An array of errors found during ReSpec's processing, with each item containing an error message and the plugin name where that error occurred. See RespecError for all available fields and their details.

document.respec.warnings {#document.respec.warnings}

Similar to document.respec.errors, but contains warnings instead of errors.

document.respec.toHTML() {#document.respec.toHTML}

Returns a promise that resolves with the markup resulting from ReSpec's processing, as a string.

Guides

Configuration options

W3C Configuration options

Linter rules

Internal properties

Handled by ReSpec for you.

Special <section> IDs

HTML elements

Custom Elements

WebIDL

HTML attributes

CSS Classes

Special properties

Clone this wiki locally