pug-filter-ctp

0.0.5 • Public • Published

pug-filter-ctp

What it does

pug-filter-ctp provides pug ctp(cake) filter!
It is also possible to output PHP Syntax with option specification.

:ctp
  $title
:ctp(php)
  echo $title;

Renders:

<?= $title ?>
<?php echo $title; ?>

How to use

Example:

var gulp = require('gulp'),
    pug  = require('gulp-pug'),
    pugCtpFilter = require('pug-filter-ctp');

gulp.task('pug', () => {
  return gulp.src(['./pug/**/*.pug', '!./pug/**/_*.pug'])
    .pipe(pug({
      filters: {
        ctp: pugCtpFilter
      },
      pretty: true
    }))
    .pipe(gulp.dest('./html/'));
});

Readme

Keywords

Package Sidebar

Install

npm i pug-filter-ctp

Weekly Downloads

4

Version

0.0.5

License

MIT

Last publish

Collaborators

  • moccigraph