diff --git a/README.md b/README.md index 0893f90..b9aefc1 100644 --- a/README.md +++ b/README.md @@ -2,81 +2,62 @@ Can include .less stylesheets into HTML template instead of common css manager's output (even if has printed). -For now supports only plain php templates. Twig, Yii, Laravel, etc will be supported in nearest future using additional bridges. +For now supports only plain php templates (works in Bitrix, Wordpress etc). +Twig, Yii, Laravel, etc will be supported in nearest future using additional bridges. ## Workflow +Draft for now: + * Requesting `www.yourdomain.com/{lessnichy-dir}` from browser for log in to Lessnichy site-wide session. * After session opened, small helper toolbar will be sticked at browser window in any site page. * Edit & upload your LESS files, they will be compiled & saved automatically ### Browser toolbar features +Planned the following: + * notify about changed LESS files * re-compile page stylesheets by demand * turn less.watchMode on & off * log you out from session -### Draft code plan +### Where to put it and how to use ```yaml # app directories structure /webroot /app-can-have-any-files + ... + template-somewhere.php # use LESS::connect() in , calls server /any-folder - /lessnichy - /js - lessnichy.js # client-side LESS compilation listener - index.php # lessnichy sources entry point - slim.phar # distribute router in compact way - Lessnichy.php # service facade - + /lessnichy-custom-dir # must be web accessible + index.php # lessnichy sources entry point, use LESS::listen() + lessnichy.phar # include this in index.php before listen + .htaccess # copy from /example dir, to catch browser yoddles, will be auto-bundled in future + ``` ```yaml -# config +# config.yaml or json, for future versions minify: true gzip: false +enable_less: true # for LESS developing sessions #etc ``` -```php -// index.php +## Requirements -$app->get('/', function(){ - // session login functionality - // + give hints doc about usage & workflow -}); +- php 5.3+ +- jquery on client side +- no node.js, additional libs, even composer! -$app->get('/:sourcename.css', function(){ - // gzip css output -}); +## Building phar -$app->put('/:sourcename.less', function(){ - // update CSS file content with internal minifier - // using for example https://packagist.org/packages/matthiasmullie/minify -}); -``` - -```php -// workflow - -// 1. Print trackable .less sources somewhere on php template -Lessnichy::register([ - '/css/main.less', // webroot will be guessed if path starts from / - '@webroot/css/add-lib.less', // maybe paths will be just webroot-related or @tokenized -]); - -/* - under the hood: - - bootstrap Lessnichy on first register() call - - detect absolute url for ajax calls - - register_shutdown_function() for post-printing LESS.compiled hook with DOM Mutation Observer - - queue LESS scripts setup: - - var less = {watch: true, interval: 3000} from add options, must be printed before less.js script - - queue registered files - - print task - - capture mapped and replace with .less on shutdown if possible -*/ +Clone repo on your dev machine with git & phing installed run ``` +phing build +``` + +Wait about 10 seconds. Voila! \ No newline at end of file