Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
samjoch committed Feb 9, 2013
1 parent 8dc081b commit 196d703
Showing 1 changed file with 22 additions and 29 deletions.
51 changes: 22 additions & 29 deletions README.md
@@ -1,6 +1,6 @@
# grunt-append-templates

> Append all templates views in index.html body in script tag.
> Append all templates views in index.html body in script tags.
## Getting Started
_If you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide._
Expand Down Expand Up @@ -32,57 +32,50 @@ In your project's Gruntfile, add a section named `append_templates` to the data
grunt.initConfig({
append_templates: {
options: {
// Task-specific options go here.
tag: 'script',
type: 'text/x-template',
layout: 'app/templates/layout.html'
},
your_target: {
// Target-specific file lists and/or options go here.
files: {
‘path/to/index.html: [path/to/templates/*.html]
}
},
},
})
```
### Options
#### options.separator
#### options.tag
Type: `String`
Default value: `', '`
Default value: `script`
A string value that is used to do something with whatever.
A string value that is used to do include each template as html content.
#### options.punctuation
#### options.type
Type: `String`
Default value: `'.'`
Default value: `text/x-template`
A string value that is used to do something else with whatever else.
A string value that is used to do represent to template you used in your project.
#### options.layout
Type: `String`
Default value: `app/templates/layout.html`
The value represent the default layout file of your project.
### Usage Examples
#### Default Options
In this example, the default options are used to do something with whatever. So if the `testing` file has the content `Testing` and the `123` file had the content `1 2 3`, the generated result would be `Testing, 1 2 3.`
In this example, the default options are used to insert all templates of the project in the default layout file.
```js
grunt.initConfig({
append_templates: {
options: {},
files: {
'dest/default_options': ['src/testing', 'src/123'],
},
},
})
```

#### Custom Options
In this example, custom options are used to do something else with whatever else. So if the `testing` file has the content `Testing` and the `123` file had the content `1 2 3`, the generated result in this case would be `Testing: 1 2 3 !!!`

```js
grunt.initConfig({
append_templates: {
options: {
separator: ': ',
punctuation: ' !!!',
},
files: {
'dest/default_options': ['src/testing', 'src/123'],
‘public/index.html’: [‘app/templates/**/*.html’],
},
},
})
Expand All @@ -92,4 +85,4 @@ grunt.initConfig({
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt][].
## Release History
_(Nothing yet)_
0.1.0 - Initial Version

0 comments on commit 196d703

Please sign in to comment.