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# @adobe/css-tools2 3> A modern CSS parser and stringifier with TypeScript support4 5[](https://badge.fury.io/js/%40adobe%2Fcss-tools)6[](https://opensource.org/licenses/MIT)7 8Parse CSS into an Abstract Syntax Tree (AST) and convert it back to CSS with configurable formatting. Built with TypeScript for type safety and modern JavaScript features.9 10## Install11 12```bash13npm install @adobe/css-tools14```15 16## Usage17 18```js19import { parse, stringify } from '@adobe/css-tools'20 21// Parse CSS to AST22const ast = parse('body { font-size: 12px; }')23 24// Stringify AST back to CSS25const css = stringify(ast)26// => "body { font-size: 12px; }"27 28// Pretty print with custom indentation29const formatted = stringify(ast, { indent: ' ' })30// => "body {\n font-size: 12px;\n}"31 32// Minify output33const minified = stringify(ast, { compress: true })34// => "body{font-size:12px}"35```36 37## API38 39### `parse(code, options?)`40 41Parses CSS code and returns an Abstract Syntax Tree (AST).42 43**Parameters:**44- `code` (string) - The CSS code to parse45- `options` (object, optional) - Parsing options46 - `silent` (boolean) - Silently fail on parse errors instead of throwing47 - `source` (string) - File path for better error reporting48 49**Returns:** `CssStylesheetAST` - The parsed CSS as an AST50 51### `stringify(ast, options?)`52 53Converts a CSS AST back to CSS string with configurable formatting.54 55**Parameters:**56- `ast` (CssStylesheetAST) - The CSS AST to stringify57- `options` (object, optional) - Stringification options58 - `indent` (string) - Indentation string (default: `' '`)59 - `compress` (boolean) - Whether to compress/minify the output (default: `false`)60 61**Returns:** `string` - The formatted CSS string62 63## Features64 65- **Complete CSS Support**: All standard CSS features including selectors, properties, values, at-rules, and comments66- **TypeScript Support**: Full type definitions for all AST nodes and functions67- **Error Handling**: Configurable error handling with detailed position information68- **Formatting Options**: Pretty print, minify, or custom formatting69- **Performance Optimized**: Efficient parsing and stringification for large CSS files70- **Source Maps**: Track original source positions for debugging and tooling71 72### Supported CSS Features73 74- **Selectors**: Element, class, ID, attribute, pseudo-class, pseudo-element selectors75- **Properties**: All standard CSS properties and custom properties76- **Values**: Colors, lengths, percentages, functions, calc(), etc.77- **At-rules**: @media, @keyframes, @import, @charset, @namespace, @font-face, @page, @document, @supports, @container, @layer, @starting-style, @host, @custom-media78- **Comments**: Both /* */ and // comments79- **Whitespace**: Preserves formatting information80- **Vendor prefixes**: Supports vendor-prefixed at-rules and properties81- **Nested rules**: Media queries, supports, containers, etc.82- **Complex selectors**: Combinators, pseudo-selectors, attribute selectors83 84## Examples85 86### Error Handling87 88```js89import { parse } from '@adobe/css-tools'90 91const malformedCss = `92 body { color: red; }93 { color: blue; } /* Missing selector */94 .valid { background: green; }95`96 97// Parse with silent error handling98const result = parse(malformedCss, { silent: true })99 100// Check for parsing errors101if (result.stylesheet.parsingErrors) {102 console.log('Parsing errors:', result.stylesheet.parsingErrors.length)103 result.stylesheet.parsingErrors.forEach(error => {104 console.log(`Error at line ${error.line}: ${error.message}`)105 })106}107 108// Valid rules are still parsed109console.log('Valid rules:', result.stylesheet.rules.length)110```111 112### Source Tracking113 114```js115import { parse } from '@adobe/css-tools'116 117const css = 'body { color: red; }'118const ast = parse(css, { source: 'styles.css' })119 120// Position information is available121const rule = ast.stylesheet.rules[0]122console.log(rule.position?.source) // "styles.css"123console.log(rule.position?.start) // { line: 1, column: 1 }124console.log(rule.position?.end) // { line: 1, column: 20 }125```126 127For more examples, see the [Examples documentation](docs/EXAMPLES.md).128 129## Performance130 131The library is optimized for performance and can handle large CSS files efficiently. For benchmarking information, see the `benchmark/` directory in the source code.132 133## Documentation134 135- [API Reference](docs/API.md) - Complete API documentation136- [AST Structure](docs/AST.md) - Detailed AST node types and structure137- [Examples](docs/EXAMPLES.md) - Comprehensive usage examples138- [Changelog](docs/CHANGELOG.md) - Version history and changes139 140## Background141 142This is a fork of the npm `css` package, maintained by Adobe with modern improvements including TypeScript support, enhanced performance, and security updates. It provides a robust foundation for CSS tooling, preprocessing, and analysis.143 144## License145 146[MIT](LICENSE)147 