Reshape hfill
Reshape hfill lets you easily use contextual headings in HTML, like the
proposed <h>
element.
<!-- before -->Heading... Heading ... X Heading ... ... Heading ... <!-- after -->Heading... Heading ... X Heading ... ... Heading ... <!-- or, alternatively -->Heading... Heading ... X Heading ... ... Heading ...
Usage
Add Reshape and Reshape hfill to your build tool:
npm install reshape reshape-hfill --save-dev
Use Reshape hfill as a plugin:
;; ;
Options
headings
Type: Object
Default: { "h": [ "h", "h1", "h2", "h3", "h4", "h5", "h6" ] }
A list of heading tags that should be created from the array of tags, alternatively transforming them into their calculated hierarchical level by a numerical range.
Example: Only transform <h>
tags:
Example: Transform many tags into their calculated hierarchical level (1-6):
sections
Type: Array
Default: [ "article", "aside", "nav", "section" ]
A list of sectioning content tags used to calculate the hierarchical level of heading tags.
Example: Only increase the hierarchical level on <article>
, <aside>
,
and <section>
tags: