Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Nov 1, 2021
1 parent 1f8c8ff commit c2d8343
Showing 1 changed file with 81 additions and 19 deletions.
100 changes: 81 additions & 19 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,57 @@
[![Size][size-badge]][size]

List of known HTML tag names.
Includes ancient (for example, `nextid` and `basefont`) and modern (for example,
`shadow` and `template`) names from the HTML living standard.

The repo includes a script to crawl specs to include newly introduced names.
## Contents

## Install
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`htmlTagNames`](#htmltagnames)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package is ESM only: Node 12+ is needed to use it and it must be `import`ed
instead of `require`d.
This is a list of HTML tag names.
It includes ancient (for example, `nextid` and `basefont`) and modern (for
example, `shadow` and `template`) names from the HTML living standard.
The repo includes scripts to regenerate the data from the specs.

[npm][]:
## When should I use this?

You can use this package when you need to know what tag names are allowed in
any version of HTML.

## Install

This package is [ESM only][esm].
In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]:

```sh
npm install html-tag-names
```

In Deno with [Skypack][]:

```js
import {htmlTagNames} from 'https://cdn.skypack.dev/html-tag-names@2?dts'
```

In browsers with [Skypack][]:

```html
<script type="module">
import {htmlTagNames} from 'https://cdn.skypack.dev/html-tag-names@2?min'
</script>
```

## Use

```js
Expand Down Expand Up @@ -66,22 +101,41 @@ There is no default export.

### `htmlTagNames`

`string[]` — List of lowercase tag names.
List of known (lowercase) HTML tag names (`Array<string>`).

## Types

This package is fully typed with [TypeScript][].

## Compatibility

This package is at least compatible with all maintained versions of Node.js.
As of now, that is Node.js 12.20+, 14.14+, and 16.0+.
It also works in Deno and modern browsers.

## Security

This package is safe.

## Related

* [`mathml-tag-names`](https://github.com/wooorm/mathml-tag-names)
List of MathML tags
* [`svg-tag-names`](https://github.com/wooorm/svg-tag-names)
List of SVG tags
* [`react-tag-names`](https://github.com/jgierer12/react-tag-names)
* [`wooorm/mathml-tag-names`](https://github.com/wooorm/mathml-tag-names)
list of MathML tag names
* [`wooorm/svg-tag-names`](https://github.com/wooorm/svg-tag-names)
list of SVG tag names
* [`jgierer12/react-tag-names`](https://github.com/jgierer12/react-tag-names)
— List of React’s HTML and SVG tag names
* [`svg-element-attributes`](https://github.com/wooorm/svg-element-attributes)
— Map of SVG elements to allowed attributes
* [`html-element-attributes`](https://github.com/wooorm/html-element-attributes)
— Map of HTML elements to allowed attributes
* [`aria-attributes`](https://github.com/wooorm/aria-attributes)
— List of ARIA attributes
* [`wooorm/svg-element-attributes`](https://github.com/wooorm/svg-element-attributes)
— map of SVG elements to attributes
* [`wooorm/html-element-attributes`](https://github.com/wooorm/html-element-attributes)
— map of HTML elements to attributes
* [`wooorm/aria-attributes`](https://github.com/wooorm/aria-attributes)
— list of ARIA attributes

## Contribute

Yes please!
See [How to Contribute to Open Source][contribute].

## License

Expand All @@ -107,6 +161,14 @@ There is no default export.

[npm]: https://docs.npmjs.com/cli/install

[skypack]: https://www.skypack.dev

[license]: license

[author]: https://wooorm.com

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[typescript]: https://www.typescriptlang.org

[contribute]: https://opensource.guide/how-to-contribute/

0 comments on commit c2d8343

Please sign in to comment.