Skip to content

Commit

Permalink
Merge pull request #11 from akempes/master
Browse files Browse the repository at this point in the history
Added support for PHP files
  • Loading branch information
Krzysztof Antczak committed Feb 4, 2015
2 parents 3cc88cd + 19872a2 commit 7c7326e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions Gruntfile.js
Expand Up @@ -19,6 +19,7 @@ module.exports = function(grunt) {
html: true,
js: true,
css: true,
php: true,
clean: true,
block: {
open: 'devcode',
Expand Down
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -24,6 +24,7 @@ Little watch task (livereload section) change:
files: [
'<%= yeoman.app %>/{,*/}*.html',
'{.tmp,<%= yeoman.app %>}/styles/{,*/}*.css',
'{.tmp,<%= yeoman.app %>}/{,*/}*.php',
'{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js',
'<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg}'
],
Expand Down Expand Up @@ -77,6 +78,7 @@ Build task configuration
html: true, // html files parsing?
js: true, // javascript files parsing?
css: true, // css files parsing?
php: true, // php files parsing?
clean: true, // removes devcode comments even if code was not removed
block: {
open: 'devcode', // with this string we open a block of code
Expand Down Expand Up @@ -110,7 +112,7 @@ Devcode usage (html files):
this code will show for all environment types but production
```

Devcode usage (js and css files):
Devcode usage (js, css and php files):
```
// devcode: !production
body {
Expand Down
6 changes: 5 additions & 1 deletion tasks/devcode.js
Expand Up @@ -42,7 +42,7 @@ function init(grunt)
var startblock = '<!--\\s*'+cOpen+':\\s*([^-]+)-->';
var endblock = '<!--\\s*'+cClose+'\\s*-->';
}
else if ( type == 'js' || type == 'css' )
else if ( type == 'js' || type == 'css' || type == 'php' )
{
var startblock = '\/\/\\s*'+cOpen+':\\s*?([^\\n]+)';
var endblock = '\/\/\\s*'+cClose+'\\s*';
Expand Down Expand Up @@ -106,5 +106,9 @@ function init(grunt)
{
replaceCode(grunt.file.expand({cwd: srcDir, filter : "isFile"},'**/*.css'), 'css');
}
if ( options.php == true )
{
replaceCode(grunt.file.expand({cwd: srcDir, filter : "isFile"},'**/*.php'), 'php');
}
});
};

0 comments on commit 7c7326e

Please sign in to comment.