AK-21/Graphite-Industrial-Intelligence
0
1# micromark-util-subtokenize2 3[![Build][build-badge]][build]4[![Coverage][coverage-badge]][coverage]5[![Downloads][downloads-badge]][downloads]6[![Size][bundle-size-badge]][bundle-size]7[![Sponsors][sponsors-badge]][opencollective]8[![Backers][backers-badge]][opencollective]9[![Chat][chat-badge]][chat]10 11[micromark][] utility to tokenize subtokens.12 13## Contents14 15* [What is this?](#what-is-this)16* [When should I use this?](#when-should-i-use-this)17* [Install](#install)18* [Use](#use)19* [API](#api)20 * [`subtokenize(events)`](#subtokenizeevents)21* [Types](#types)22* [Compatibility](#compatibility)23* [Security](#security)24* [Contribute](#contribute)25* [License](#license)26 27## What is this?28 29This package exposes a micromark internal that you probably don’t need.30 31## When should I use this?32 33This package might be useful when you are making your own micromark extensions.34 35## Install36 37This package is [ESM only][esm].38In Node.js (version 16+), install with [npm][]:39 40```sh41npm install micromark-util-subtokenize42```43 44In Deno with [`esm.sh`][esmsh]:45 46```js47import {subtokenize} from 'https://esm.sh/micromark-util-subtokenize@1'48```49 50In browsers with [`esm.sh`][esmsh]:51 52```html53<script type="module">54 import {subtokenize} from 'https://esm.sh/micromark-util-subtokenize@1?bundle'55</script>56```57 58## Use59 60```js61import {subtokenize} from 'micromark-util-subtokenize'62 63/**64 * Content is transparent: it’s parsed right now. That way, definitions are also65 * parsed right now: before text in paragraphs (specifically, media) are parsed.66 *67 * @type {Resolver}68 */69function resolveContent(events) {70 subtokenize(events)71 return events72}73```74 75## API76 77This module exports the identifiers [`subtokenize`][api-subtokenize].78There is no default export.79 80### `subtokenize(events)`81 82Tokenize subcontent.83 84###### Parameters85 86* `events` (`Array<Event>`)87 — list of events88 89###### Returns90 91Whether subtokens were found (`boolean`).92 93## Types94 95This package is fully typed with [TypeScript][].96It exports no additional types.97 98## Compatibility99 100Projects maintained by the unified collective are compatible with maintained101versions of Node.js.102 103When we cut a new major release, we drop support for unmaintained versions of104Node.105This means we try to keep the current release line,106`micromark-util-subtokenize@2`, compatible with Node.js 16.107This package works with `micromark@3`.108 109## Security110 111This package is safe.112See [`security.md`][securitymd] in [`micromark/.github`][health] for how to113submit a security report.114 115## Contribute116 117See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways118to get started.119See [`support.md`][support] for ways to get help.120 121This project has a [code of conduct][coc].122By interacting with this repository, organisation, or community you agree to123abide by its terms.124 125## License126 127[MIT][license] © [Titus Wormer][author]128 129<!-- Definitions -->130 131[api-subtokenize]: #subtokenizeevents132 133[author]: https://wooorm.com134 135[backers-badge]: https://opencollective.com/unified/backers/badge.svg136 137[build]: https://github.com/micromark/micromark/actions138 139[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg140 141[bundle-size]: https://bundlejs.com/?q=micromark-util-subtokenize142 143[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-subtokenize144 145[chat]: https://github.com/micromark/micromark/discussions146 147[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg148 149[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md150 151[contributing]: https://github.com/micromark/.github/blob/main/contributing.md152 153[coverage]: https://codecov.io/github/micromark/micromark154 155[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg156 157[downloads]: https://www.npmjs.com/package/micromark-util-subtokenize158 159[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-subtokenize.svg160 161[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c162 163[esmsh]: https://esm.sh164 165[health]: https://github.com/micromark/.github166 167[license]: https://github.com/micromark/micromark/blob/main/license168 169[micromark]: https://github.com/micromark/micromark170 171[npm]: https://docs.npmjs.com/cli/install172 173[opencollective]: https://opencollective.com/unified174 175[securitymd]: https://github.com/micromark/.github/blob/main/security.md176 177[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg178 179[support]: https://github.com/micromark/.github/blob/main/support.md180 181[typescript]: https://www.typescriptlang.org182 