Brunobkr/llama.cpp_AlgMor24_github
ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.
03.1k
1# hast-util-from-dom2 3[![Build][build-badge]][build]4[![Coverage][coverage-badge]][coverage]5[![Downloads][downloads-badge]][downloads]6[![Size][size-badge]][size]7[![Sponsors][sponsors-badge]][collective]8[![Backers][backers-badge]][collective]9[![Chat][chat-badge]][chat]10 11[hast][] utility to transform from a [DOM][] tree.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 * [`fromDom(tree, options?)`](#fromdomtree-options)21 * [`AfterTransform`](#aftertransform)22 * [`Options`](#options)23* [Types](#types)24* [Compatibility](#compatibility)25* [Security](#security)26* [Contribute](#contribute)27* [Related](#related)28* [License](#license)29 30## What is this?31 32This package is a utility that takes a DOM tree (from the actual DOM or from33things like [`jsdom`][jsdom]) as input and turns it into a [hast][] (HTML)34syntax tree.35 36## When should I use this?37 38You can use this project when you want to use hast in browsers.39This package is very small, but it does so by:40 41* …not providing positional information42* …potentially yielding varying results in different (especially older)43 browsers44 45The hast utility [`hast-util-to-dom`][hast-util-to-dom] does the inverse of this46utility.47It turns hast into a DOM tree.48 49The rehype plugin [`rehype-dom-parse`][rehype-dom-parse] wraps this utility to50parse HTML with DOM APIs.51 52## Install53 54This package is [ESM only][esm].55In Node.js (version 16+), install with [npm][]:56 57```sh58npm install hast-util-from-dom59```60 61In Deno with [`esm.sh`][esmsh]:62 63```js64import {fromDom} from 'https://esm.sh/hast-util-from-dom@5'65```66 67In browsers with [`esm.sh`][esmsh]:68 69```html70<script type="module">71 import {fromDom} from 'https://esm.sh/hast-util-from-dom@5?bundle'72</script>73```74 75## Use76 77Say our page `example.html` looks as follows:78 79```html80<!doctype html>81<title>Example</title>82<body>83 <main>84 <h1>Hi</h1>85 <p><em>Hello</em>, world!</p>86 </main>87 <script type="module">88 import {fromDom} from 'https://esm.sh/hast-util-from-dom@4?bundle'89 90 const hast = fromDom(document.querySelector('main'))91 92 console.log(hast)93 </script>94```95 96Now running `open example.html` prints the following to the console:97 98```js99{type: "element", tagName: "main", properties: {}, children: Array}100```101 102## API103 104This package exports the identifier [`fromDom`][api-from-dom].105There is no default export.106 107### `fromDom(tree, options?)`108 109Transform a DOM tree to a hast tree.110 111###### Parameters112 113* `tree` ([`DomNode`][dom-node])114 — DOM tree to transform115* `options` ([`Options`][api-options], optional)116 — configuration117 118###### Returns119 120Equivalent hast node ([`HastNode`][hast-node]).121 122### `AfterTransform`123 124Callback called when each node is transformed (TypeScript type).125 126###### Parameters127 128* `domNode` ([`DomNode`][dom-node])129 — DOM node that was handled130* `hastNode` ([`HastNode`][hast-node])131 — corresponding hast node132 133###### Returns134 135Nothing.136 137### `Options`138 139Configuration (TypeScript type).140 141##### Fields142 143* `afterTransform` ([`AfterTransform`][api-after-transform], optional)144 — callback called when each node is transformed145 146##### Returns147 148[`HastNode`][hast-node].149 150## Types151 152This package is fully typed with [TypeScript][].153It exports the additional types [`AfterTransform`][api-after-transform] and154[`Options`][api-options].155 156## Compatibility157 158Projects maintained by the unified collective are compatible with maintained159versions of Node.js.160 161When we cut a new major release, we drop support for unmaintained versions of162Node.163This means we try to keep the current release line, `hast-util-from-dom@^5`,164compatible with Node.js 16.165 166## Security167 168Use of `hast-util-from-dom` itself is safe but see other utilities for more169information on potential security problems.170 171## Contribute172 173See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for174ways to get started.175See [`support.md`][support] for ways to get help.176 177This project has a [code of conduct][coc].178By interacting with this repository, organisation, or community you agree to179abide by its terms.180 181## Related182 183* [`hast-util-from-html`][hast-util-from-html]184 — parse hast from a string of HTML185* [`hast-util-sanitize`](https://github.com/syntax-tree/hast-util-sanitize)186 — sanitize hast nodes187* [`hast-util-to-html`](https://github.com/syntax-tree/hast-util-to-html)188 — serialize hast as HTML189* [`hast-util-to-dom`](https://github.com/syntax-tree/hast-util-to-dom)190 — create DOM trees from hast191 192## License193 194[ISC][license] © [Keith McKnight][author]195 196<!-- Definitions -->197 198[build-badge]: https://github.com/syntax-tree/hast-util-from-dom/workflows/main/badge.svg199 200[build]: https://github.com/syntax-tree/hast-util-from-dom/actions201 202[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/hast-util-from-dom.svg203 204[coverage]: https://codecov.io/github/syntax-tree/hast-util-from-dom205 206[downloads-badge]: https://img.shields.io/npm/dm/hast-util-from-dom.svg207 208[downloads]: https://www.npmjs.com/package/hast-util-from-dom209 210[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=hast-util-from-dom211 212[size]: https://bundlejs.com/?q=hast-util-from-dom213 214[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg215 216[backers-badge]: https://opencollective.com/unified/backers/badge.svg217 218[collective]: https://opencollective.com/unified219 220[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg221 222[chat]: https://github.com/syntax-tree/unist/discussions223 224[npm]: https://docs.npmjs.com/cli/install225 226[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c227 228[esmsh]: https://esm.sh229 230[typescript]: https://www.typescriptlang.org231 232[license]: license233 234[author]: https://keith.mcknig.ht235 236[health]: https://github.com/syntax-tree/.github237 238[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md239 240[support]: https://github.com/syntax-tree/.github/blob/main/support.md241 242[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md243 244[hast]: https://github.com/syntax-tree/hast245 246[hast-node]: https://github.com/syntax-tree/hast#nodes247 248[dom]: https://developer.mozilla.org/docs/Web/API/Document_Object_Model249 250[dom-node]: https://developer.mozilla.org/docs/Web/API/Node251 252[hast-util-from-html]: https://github.com/syntax-tree/hast-util-from-html253 254[hast-util-to-dom]: https://github.com/syntax-tree/hast-util-to-dom255 256[rehype-dom-parse]: https://github.com/rehypejs/rehype-dom/tree/main/packages/rehype-dom-parse257 258[jsdom]: https://github.com/jsdom/jsdom259 260[api-from-dom]: #fromdomtree-options261 262[api-options]: #options263 264[api-after-transform]: #aftertransform265 