Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/titarenko/gulp-dotify
Gulp plugin for precompilation of doT templates.
https://github.com/titarenko/gulp-dotify
Last synced: about 1 month ago
JSON representation
Gulp plugin for precompilation of doT templates.
- Host: GitHub
- URL: https://github.com/titarenko/gulp-dotify
- Owner: titarenko
- Created: 2014-01-22T13:30:09.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-04-10T09:46:42.000Z (over 10 years ago)
- Last Synced: 2024-12-02T09:09:47.437Z (about 1 month ago)
- Language: JavaScript
- Size: 182 KB
- Stars: 8
- Watchers: 6
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gulp-dotify
[Gulp](https://github.com/gulpjs/gulp) plugin for precompilation of [doT](https://github.com/olado/doT) templates.
## Status
[![Build Status](https://secure.travis-ci.org/titarenko/gulp-dotify.png?branch=master)](https://travis-ci.org/titarenko/gulp-dotify)
[![Code Climate](https://codeclimate.com/github/titarenko/gulp-dotify.png)](https://codeclimate.com/github/titarenko/gulp-dotify)
[![Coverage Status](https://coveralls.io/repos/titarenko/gulp-dotify/badge.png)](https://coveralls.io/r/titarenko/gulp-dotify)[![NPM](https://nodei.co/npm/gulp-dotify.png?downloads=true&stars=true)](https://nodei.co/npm/gulp-dotify/)
## Example
If we have following folder structure:
```
app/views/users/list.html
app/views/users/detail.html
app/views/products/list.html
app/views/products/detail.html
app/views/layout.html
```Then, running this code:
```js
gulp.task('templates', function() {
gulp.src('app/views/**/*.html')
.pipe(dotify())
.pipe(concat('templates.js'))
.pipe(header('window.JST = {};'))
.pipe(gulp.dest('public/js'));
});
```Will produce `public/js/templates.js`:
```js
window.JST = {};
JST['users-list'] = function ...
JST['users-detail'] = function ...
...
JST['layout'] = function ...
```## Options
* root -- root folder, where templates are located (affects template name generation), `views` by default
* extension -- file extension of template files, `.html` by default
* separator -- template namespace-name separator, `-` by default
* dictionary -- template dictionary name, `JST` by default## License
MIT