Write Jade templates, parse them with original Jade parser (not a PHP port) and convert into equivalent PHP templates.
- install gulp-jade2phpv2:
npm install --save gulp-jade2phpv2
- install command line utility:
npm install -g jade2phpv2
- install node module for API usage:
npm install --save jade2phpv2
Full support for all Jade features is maintained through unit testing, based on Language Reference.
Additional, code-level checks
JadePhpCompiler rendering simple jade syntax into vanilla html ✓ should support simple text ✓ should support simple tags ✓ should support self-closing tags ✓ should support doctypes ✓ should support tags with text ✓ should support tags with attrs ✓ should support classes via dot notation ✓ should support ids via sharp notation ✓ should support nested tags rendering simple expressions ✓ should support simple output ✓ should support simple unescaped output ✓ should support attr values ✓ should support attr unescaped values ✓ should support tag text ✓ should support tag unescaped text ✓ should support several attrs and text string interpolation ✓ should support simple string output ✓ should support simple unsecaped string output ✓ should support simple interpolation with variable ✓ should support simple attr interpolation with variable control statements condition if ✓ simple ✓ with else ✓ several if-else-if-else-if-else ✓ support negated if – unless case ✓ string comparisons ✓ numeric comparisons ✓ default comparisons iteration ✓ simple ✓ simple with indexing ✓ alternative code node ✓ simple class attribute ✓ simple mixins ✓ simple ✓ with args ✓ name with dashes ✓ support mixin blocks ✓ support call mixin inside mixin with blocks ✓ support rest params
- pretty php code option
- pretty html output option
- code cleanup
PHP must be installed to run tests.
npm install --devnpm test
Pull requests, sharing experience and ideas are welcomed :)