-
-
Notifications
You must be signed in to change notification settings - Fork 420
data cite
Applies to: any element
Manually links an element to a specific term, section, or spec — or scopes all xref lookups within a container to a specific spec.
| Situation | Use |
|---|---|
| Term is in the xref database |
[=term=] shorthand (preferred) |
| Term is not exported by the defining spec |
data-cite="SPEC#anchor" on a container |
| Linking to a section heading (not a term) |
[[[SPEC#section-id]]] or data-cite="SPEC#section-id"
|
| Linking to the spec itself (bibliography) | data-cite="SPEC" |
| Documenting a term defined elsewhere (re-exporting) | <dfn data-cite="SPEC#dfn-id"> |
data-cite="[!]SPEC-ID[/path-to-doc][#fragment]"
-
!— normative citation (omit for informative) -
SPEC-ID— shortname from SpecRef -
/path-to-doc— sub-path for multi-page specs -
#fragment— anchor ID in the target document
When placed on any container element, data-cite scopes all {{IDL}}, [=term=], and [^element^] lookups within that element to the named spec. This is the preferred way to reference terms from specs not in your xref profile:
<section data-cite="fileapi">
<p>The {{Blob}} interface represents raw binary data.
A {{File}} is a {{Blob}} with a name.</p>
</section><li data-cite="fileapi">Assert: |data| is a {{Blob}}.</li><pre class="idl" data-cite="fileapi">
typedef (DOMString or Blob) DataSource;
</pre>This is far cleaner than manually writing <a data-cite="fileapi#dom-blob">Blob</a> for every reference. The scoped spec is also added to the document's bibliography automatically.
<a data-cite="FETCH#concept-request">request</a><a data-cite="!FETCH#concept-request">request</a><p>The <dfn data-export data-cite="DOM#concept-event">event</dfn> is...</p><a data-cite="HTML#event-loop">event loop section of HTML</a><p>This is defined in [[FETCH]] — see <a data-cite="FETCH">the Fetch Standard</a>.</p><a data-cite="HTML/webappapis.html#event-loop">event loop</a>When your spec needs to use and expose a term defined elsewhere, mark a local <dfn> with data-cite pointing to the canonical definition. This tells ReSpec where the term lives without defining it locally, and makes it linkable within your spec:
<!-- This lets other parts of your spec use [=request=] to link here -->
<p>A <dfn data-cite="FETCH#concept-request" data-export>request</dfn> is...</p>- Browse spec shortnames and anchor IDs at respec.org/xref
- Always prefer
[=term=]when the term is in the xref database —data-citeis for exceptions - When using
data-cite="SPEC"without a fragment, the spec is added to the bibliography automatically
💖 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