generator-reveal
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -24,3 +24,5 @@ // Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= pkg.name %> <%= pkg.version %> | ||
'index.html', | ||
'slides/*.md' | ||
'slides/*.md', | ||
'slides/*.html', | ||
'slides/list.json' | ||
], | ||
@@ -27,0 +29,0 @@ tasks: ['build'] |
{ | ||
"name": "generator-reveal", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "A Reveal.js generator for Yeoman", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
# Generator-reveal | ||
A Reveal.js generator for Yeoman. | ||
A Yeoman generator for Reveal.js. | ||
@@ -35,3 +35,3 @@ ## Usage | ||
### Slide | ||
Generates a Slide Markdown file. | ||
Generates a Slide file. | ||
@@ -43,7 +43,9 @@ Example: | ||
Produces `slides/slide-title.md`: | ||
```markdown | ||
## Slide Title | ||
Produces `slides/slide-title.html`: | ||
This is a new slide | ||
```html | ||
<h2>Slide Title</h2> | ||
<p>This is a new slide</p> | ||
``` | ||
@@ -57,3 +59,16 @@ | ||
#### Options | ||
##### Markdown | ||
Invoked with `--markdown` | ||
Produces `slides/slide-title.md` | ||
```markdown | ||
## Slide Title | ||
This is a new slide | ||
``` | ||
## License | ||
[MIT License](http://en.wikipedia.org/wiki/MIT_License) |
@@ -7,2 +7,3 @@ 'use strict'; | ||
var SlideGenerator = module.exports = function SlideGenerator(args, options, config) { | ||
@@ -14,2 +15,13 @@ // By calling `NamedBase` here, we get the argument to the subgenerator call | ||
console.log('You called the slide subgenerator with the argument ' + this.name + '.'); | ||
if (this.options.markdown) { | ||
this.useMarkdown = true; | ||
this.filename = this._.slugify(this.name) + '.md'; | ||
console.log('Using Markdown!', this.filename); | ||
} else { | ||
this.useMarkdown = false; | ||
this.filename = this._.slugify(this.name) + '.html'; | ||
console.log('Using HTML!', this.filename); | ||
}; | ||
}; | ||
@@ -20,10 +32,13 @@ | ||
SlideGenerator.prototype.files = function files() { | ||
var filename = this._.slugify(this.name) + '.md'; | ||
var fullfilename = 'slides/' + filename; | ||
this.template('slide.md', fullfilename); | ||
var appPath = process.cwd(); | ||
var fullfilename = path.join(appPath, '/slides/' + this.filename); | ||
if (this.useMarkdown) { | ||
this.template('slide.md', fullfilename); | ||
} else { | ||
this.template('slide.html', fullfilename); | ||
} | ||
var fullPath = path.join(appPath, '/slides/list.json'); | ||
var list = require(fullPath); | ||
list.push(filename); | ||
fs.writeFileSync(fullPath, JSON.stringify(list)) | ||
list.push(this.filename); | ||
fs.writeFileSync(fullPath, JSON.stringify(list, null, 4)) | ||
}; |
## <%= name %> | ||
This is a new slide | ||
This is a new Markdown slide |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14607
26
204
72