Skip to content

Instantly share code, notes, and snippets.

@janhalfar
Created July 24, 2012 08:49
Show Gist options
  • Save janhalfar/3168912 to your computer and use it in GitHub Desktop.
Save janhalfar/3168912 to your computer and use it in GitHub Desktop.
Foomo.Huckleberry usafe example
// Huckleberry less usage example
\Foomo\Huckleberry\Less::create(
// in which module is your less file
\Foomo\Huckleberry\Module::NAME,
// name of the less file
'demo',
// give it a version <- makes deployments easier, because caches
// will not "work"
'alpha-01'
)
// only watch, when you are developing
->watch(true)
// do not uglify, when you are developing
->uglify(true)
// this call will actually process your less file, if necessary
// and it will add a link to the generated css
->linkToDoc()
;
echo \Foomo\HTMLDocument::getInstance()
->setTitle('Huckleberry less demo')
->addBody('<h1>Huckleberry less demo</h1>')
->addBody(
'<pre>' .
htmlspecialchars(file_get_contents(\Foomo\Huckleberry\Module::getBaseDir('less') . DIRECTORY_SEPARATOR . 'demo.less') ) .
'</pre>' .
'<div id="src">' .
show_source(__FILE__, true) .
'</div>'
)
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment