reshape-hfill

阅读时长 6 分钟读完

Use contextual headings in HTML

Reshape hfill

Reshape hfill lets you easily use contextual headings in HTML, like the proposed <h> element.

-- -------------------- ---- -------
---- ------ ---
--------------
----------
---------
  --------------
  ----------
  ---------
    ---- -----------
    ----------
  ----------
----------
---------
  ----------
  --------------
  ----------
----------

---- ----- ---
-- -------------- --------------------------
----------
---------
  -- -------------- --------------------------
  ----------
  ---------
    -- -------------- ---------------- -----------
    ----------
  ----------
----------
---------
  ----------
  -- -------------- --------------------------
  ----------
----------

---- --- ------------- ---
----------------
----------
---------
  ----------------
  ----------
  ---------
    ----- ------------
    ----------
  ----------
----------
---------
  ----------
  ----------------
  ----------
----------

Usage

Add Reshape and Reshape hfill to your build tool:

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:

HomePage

https://github.com/jonathantneal/reshape-hfill#readme

Repository

git+https://github.com/jonathantneal/reshape-hfill.git

来源:JavaScript中文网 ,转载请注明来源 https://www.javascriptcn.com/post/6005667f81e8991b448e292a

纠错
反馈