avastechnology / demeter
OOP approach for structural code generation.
Installs: 35
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/avastechnology/demeter
Requires
- php: ^8.4
Requires (Dev)
- avastechnology/iolaus: *
- phpunit/phpunit: ^10.0
- dev-main
- v1.1.1.x-dev
- 1.1.1
- v1.1.0.x-dev
- 1.1.0
- v1.0.0.x-dev
- 1.0.0
- 0.1.0
- dev-Fix-bug-with-parsing-compact-css-files
- dev-Rework-the-stylesheet-formatting-for-easier-extendability
- dev-Fix-rendering-associated-with-indents
- dev-Initial-implementation-of-css-handling
- dev-Shift-namespaces-to-specify-for-php-code
- dev-Shift-traits-to-object-oriented-approach
This package is auto-updated.
Last update: 2025-10-16 15:43:37 UTC
README
Demeter is OOP approach for structural code generation.
The Demeter library provides an Object-Oriented approach to building the structural units required for code generation. The goal is to make it easy to generate/modify source code.
Since this library is built primarily for developer tasks, it really should not be used on production sites, rather it should be included as part of the development package set.
This is a work in progress and only feature complete as has been needed!
Installation
Include this library:
~ composer require avastechnology/demeter --dev
CSS
Parse a CSS file into components
use AVASTech\Demeter\CSS\Parser; $parser = new Parser(); $styleSheet = $parser->parse(file_get_contents(__DIR__ . '/test.css'));
Reformat a CSS file into a pretty-print version
use AVASTech\Demeter\CSS\Parser; use AVASTech\Demeter\CSS\Formats\Factory; $parser = new Parser(); $styleSheet = $parser->parse(file_get_contents(__DIR__ . '/compact.css')); file_put_contents( __DIR__ . '/pretty.css', $styleSheet->render((new Factory())->compactStyleSheet()) );
Reformat a CSS file into a compact version
use AVASTech\Demeter\CSS\Parser; use AVASTech\Demeter\CSS\Formats\Factory; $parser = new Parser(); $styleSheet = $parser->parse(file_get_contents(__DIR__ . '/pretty.css')); file_put_contents( __DIR__ . '/compact.css', $styleSheet->render((new Factory())->compactStyleSheet()) );