Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chetan/sprockets-jst-str
Slurps template into a JavaScript string for use with Sprockets JST functionality
https://github.com/chetan/sprockets-jst-str
Last synced: 21 days ago
JSON representation
Slurps template into a JavaScript string for use with Sprockets JST functionality
- Host: GitHub
- URL: https://github.com/chetan/sprockets-jst-str
- Owner: chetan
- Created: 2012-04-27T17:33:34.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-04-06T17:10:57.000Z (over 11 years ago)
- Last Synced: 2024-11-20T01:41:37.295Z (about 1 month ago)
- Language: Ruby
- Size: 109 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sprockets-jst-str
sprockets-jst-str is a [Sprockets](https://github.com/sstephenson/sprockets) plugin which simply returns the entire template as an escaped JavaScript string. For example, a file named __hello.jst.str__:
```html
Hello <%= get('name') %>
```would turn into:
```js
'\n Hello <%= get(\'name\') %>\n
';
```In addition to single quotes, all backslashes, tabs and line breaks are also replaced with their respective symbols.