-
-
Notifications
You must be signed in to change notification settings - Fork 427
How Do I
Common tasks for ReSpec spec editors.
Use the [= term =] shorthand after enabling xref:
var respecConfig = {
xref: "web-platform", // or true, or ["FETCH", "DOM"]
};<p>Run these steps to [=fetch=] a resource.</p>
<p>Fire an [=event=] named "load" at the {{Window}} object.</p>Browse available terms at respec.org/xref.
<p>The <dfn data-export>fetch</dfn> algorithm takes a request...</p>The data-export attribute makes the term available in the xref database after your spec is crawled (usually ~6 hours after publication). See data-export.
As described in <a href="#authentication"></a>.
<!-- Empty href auto-fills with "§ N Authentication" -->This follows [[!FETCH]] (normative).
See also [[INFRA]] (informative).The ! prefix makes it normative. See the Shorthands Guide.
Use data-cite:
<a data-cite="FETCH#concept-request">request</a>
<a data-cite="!HTML#event-loop">event loop</a><section data-dfn-for="Widget" data-link-for="Widget">
<h2>The <code>Widget</code> interface</h2>
<pre class="idl">
[Exposed=Window]
interface Widget {
readonly attribute DOMString name;
undefined update(optional WidgetOptions options = {});
};
</pre>
<p>The <dfn>name</dfn> attribute returns the widget's name.</p>
<p>The <dfn>update()</dfn> method updates the widget.</p>
</section>See the WebIDL Guide.
var respecConfig = {
caniuse: "payment-request",
};var respecConfig = {
mdn: true, // uses shortName as key
};<section data-include="sections/api.html"></section><section data-include="sections/intro.md"
data-include-format="markdown"></section>Requires HTTP — see data-include.
<section class="informative">
<h2>Use Cases</h2>
<p>This section is non-normative.</p>
</section>ReSpec adds "This section is non-normative." automatically.
<div class="note">
<p>Implementations should handle this case carefully.</p>
</div><p class="ednote">TODO: clarify this algorithm.</p><ul data-sort>
<li>Zebra</li>
<li>Apple</li>
<li>Mango</li>
</ul>See data-sort.
<p data-tests="test-basic.https.html,test-error.html">
The user agent MUST reject the Promise if...
</p>Requires testSuiteURI in config. See data-tests.
<table data-lint-ignore="no-captionless-tables">
<tr><td>data without caption</td></tr>
</table>See lint-ignore.
async function fetchData(config, document) {
// runs before ReSpec
}
function cleanup(config, document) {
// runs after ReSpec
}
var respecConfig = {
preProcess: [fetchData],
postProcess: [cleanup],
};See preProcess and postProcess.
await document.respec.ready;
// document is now fully processedSee document.respec.
Click the ReSpec pill (top-right corner) → Save as HTML.
This produces a standalone HTML file with all scripts removed — suitable for W3C publication.
Alternatively, calling await document.respec.toHTML() outputs the same HTML as a string programmatically.
💖 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
- implementationStatus
- 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