phug-php / phug

Phug - The Pug Template Engine for PHP
https://phug.selfbuild.fr
MIT License
62 stars 3 forks source link

What are all these guys about: phug-pug, php-pug, pugjs, tale-pug, js-phpize-phug? #44

Closed OnkelTem closed 5 years ago

OnkelTem commented 5 years ago

Could you please explain how this bunch of things are connected and related to each other? Sorry, I couldn't find any info in the docs.

A side quesion: why when I install "pug-php/pug-symfony" it starts installing some javascript? Do it really need it or what? Does it have any relation to phug-php after all or it's based on some [previously created] wrapper around what - pugjs? Total mess...

UPDATE.

It seems to me like this page https://www.phug-lang.com/ was created as a little rambling report from a battlefield of technologies and like to understand it, you have to be aware of this battle and all its history twists.

kylekatarnls commented 5 years ago

Pugjs is pug for JavaScript (Node.js or front), this is the original project. @everzet created a port of Pug for PHP I maintained after him (pug-php, php-pug does not exist), @TorbenKoehn created an other one in parallel (tale-pug). When we discover the work of each other, we decided to work together for the new version (phug-php). If you download phug-php, you will have the raw engine and PHP expression style by default. If you download pug-php, it will use phug-php too but will use the JS-style expression by default and include pugjs as an optional way to render as it's explained in the console when you are asked if you want to install it or not:

It allows you to use the native JS pug engine instead of the default PHP one with the pugjs option set to true (It's optional you can enter N if you run composer in normal mode (interactive)).

All that is explained in the doc https://www.phug-lang.com/

What pug-php/pug-symfony propose you to install optional filters. For example:

script
  :coffee-script
    do myFunction

This filter run the JS package coffee-script to compile the coffeescript code directly inside your template.

And as pug-php/pug-symfony embbed https://github.com/pug-php/pug-minify#readme you can also use .coffee files as script(src="folder/file.coffee")

And the same for other suggested JS packages.