https://github.com/postor/gulp-jade-for-php
针对php语言的jade模板实现,利用gulp进行前端自动化| a gulp plugin for jade template adapt for php
https://github.com/postor/gulp-jade-for-php
Last synced: 3 months ago
JSON representation
针对php语言的jade模板实现,利用gulp进行前端自动化| a gulp plugin for jade template adapt for php
- Host: GitHub
- URL: https://github.com/postor/gulp-jade-for-php
- Owner: postor
- Created: 2015-05-28T01:59:33.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-30T07:41:10.000Z (over 9 years ago)
- Last Synced: 2025-01-25T18:10:05.058Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gulp-jade-for-php #
Compiles jade-php templates using gulp.
For gulp-jade-php does not support parsing attributes,so i wrote this.
This module is based on the well written jadegulp.
usage:
npm install gulp-jade-for-php
var phpJade = require('gulp-jade-for-php');
gulp.task('jade-php', function() {
gulp.src('../**/*.jade')
.pipe(phpJade())
.pipe(gulp.dest('../'));
});
针对php语言的jade模板实现,利用gulp进行前端自动化.因为 gulp-jade-php 不支持动态的属性写法,所以是这么实现的.
这个模块依赖jadegulp.
## Documentation
### Modified syntax
The following syntax sample is formatted as if pretty print option is set.#### attribute as php expression with escape.
```
tag(attr=php_function())
``````html
```
#### attribute as php expression without escape.
```
tag(attr!=php_function())
``````html
```
#### attribute as php expression without echo.
```
tag(attr!=-php_function())
``````
```
#### nameless attribute
```
tag(__=php_function())
``````html
>
```
_____________```
tag(__=php_function(), ___=php_function2())
``````html
>
```#### codes
```
tag
- php_code
``````html
```
#### php filter
```
:php
/* some php codes comes here */
call_php_function();
html
``````
```
## Examples
```
html
body
- testfunc();
div(__=some_php_function())
| test
- foreach ($this->list as $list):
li!= $list
- endforeach```
```html
>test
list as $list): ?>
```