JSPM

jade-latte

0.7.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q31575F
  • License MIT

Jade filter for PHP

Package Exports

  • jade-latte

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jade-latte) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

jade-latte

Extension allowing usage of Latte templates syntax from Nette framework in Jade templates.

Code Climate Dependency Status Build Status Coverage Status

What it does

  • Extends Jade functionality to play nice with Latte templates from Nette
  • Latte expressions in attributes are not escaped
  • Inline latte expressions in to-be-escaped content not escaped
  • Fixed Jade bug in mixins, when using namespaced attributes +mixin(n:href="{$whatever->whenever}")
  • Adds filter for PHP supporting blocks, expressions, inline expressions with tweaked solution from jade4php

What it doesn't do

  • Latte block can't nest with latte at the moment

Usage

install: npm install jade-latte test: mocha test

In templates

  • See file test/mixin-test.jade

With Jade API

var assert = require('assert'),
    jade = require('jade');

require('../index')(jade);

var html = jade.renderFile(__dirname + '/my_file.jade');

// rendered html
console.log(html);

With Gulp

gulp.src("*.jade")
    .pipe(plugins.jade({
        jade: require('jade-latte')(require('jade')),
    }))
    .pipe(gulp.dest('./build/'));

License

MIT