avastechnology/demeter
最新稳定版本:1.1.1
Composer 安装命令:
composer require avastechnology/demeter
包简介
OOP approach for structural code generation.
README 文档
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()) );
统计信息
- 总下载量: 45
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-01-02