-
-
Notifications
You must be signed in to change notification settings - Fork 389
data sort
Marcos Cáceres edited this page Nov 17, 2017
·
12 revisions
By using data-sort="ascending"
or "descending"
, ReSpec can shallow sort lists of type ol
, ul
, and dl
elements. Shallow sort meaning that only the first level of the list is sorted, and any nested lists are left alone. This is nice for Dependency sections, IDL member definitions, etc.
You can also just write data-sort
and exclude the attribute value, and it will default to "ascending" (i.e., from A-to-Z).
The following sorts to "Z, W, A".
<ul data-sort="descending">
<li>W</li>
<li>Z</li>
<li>A</li>
</ul>
Sorting a definition list ("ascending" by default, so A-to-0Z locale dependent). The corresponding dd
s for any dt
are also moved, but not sorted.
<dl data-sort>
<dt>Bananas</dt>
<dd>Are the best!</dd>
<dt>Zebra</dt>
<dd>This are stripy.</dd>
<!-- The following tree are first after sorting -->
<dt>Apple</dt>
<dd>Are delicious.</dd>
<dd>They really really are!</dd>
</dl>
💖 Support ReSpec by becoming a sponsor via Open Collective. 💖
✨ View rendered version of this documentation at https://respec.org/docs/ ✨
- addSectionLinks
- authors
- caniuse
- edDraftURI
- editors
- favicon
- format (markdown)
- formerEditors
- github
- highlightVars
- isPreview
- license
- lint
- localBiblio
- logos
- maxTocLevel
- mdn
- modificationDate
- noTOC
- otherLinks
- pluralize
- postProcess
- preProcess
- previousDiffURI
- previousMaturity
- previousPublishDate
- prevRecShortname
- prevRecURI
-
processVersion(Deprecated) - publishDate
-
refNote(Deprecated) - shortName
- specStatus
- subjectPrefix
- subtitle
- testSuiteURI
- xref
- additionalCopyrightHolders
-
addPatentNote(Deprecated) - alternateFormats
- canonicalURI
- charterDisclosureURI
- copyrightStart
- crEnd
-
darkMode(deprecated, use dark mode) - doJsonLd
- errata
- group
- implementationReportURI
- lcEnd
- level
- noRecTrack
- prevED
- submissionCommentNumber
-
wg(Deprecated) -
wgId(Deprecated) -
wgPatentPolicy(Deprecated) -
wgPatentURI(Deprecated) - wgPublicList
-
wgURI(Deprecated)
a11y
check-punctuation
local-refs-exist
no-headingless-sections
no-http-props
no-unused-vars
no-unused-dfns
informative-dfn
privsec-section
wpt-tests-exist
Handled by ReSpec for you.
- data-abbr
-
data-cite(Not recommended) - data-dfn-for
- data-dfn-type
- data-format
- data-include-format
- data-include-replace
- data-include
- data-link-for
- data-link-type
- data-local-lt
- data-lt-no-plural
- data-lt-noDefault
- data-lt
- data-number
- data-oninclude
- data-sort
- data-tests
-
data-transform(Deprecated) - data-type
- dir
- lang