-
-
Save saurik/980168 to your computer and use it in GitHub Desktop.
JavaScript VS CoffeeScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate | |
generate: (next) -> | |
# Check | |
if DocPad.genetating then return | |
else DocPad.generating = true | |
# Continue | |
path.exists DocPad.options.srcPath, (exists) -> | |
# Check | |
if not exists then throw Error 'Cannot generate website as the src dir was not found' | |
# Continue | |
util.rmdir DocPad.options.outPath, -> | |
DocPad.generateClean -> << | |
DocPad.generateParse -> << | |
DocPad.generateRelations -> << | |
DocPad.generateRender -> << | |
DocPad.generateWrite -> | |
console.log 'Website Generated' | |
DocPad.generating = false | |
if next then next() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Generate the Static Website | |
* 1. Clean the Database | |
* 2. Parse the Source files | |
* 3. Render the Source Files | |
*/ | |
generate: function(next) { | |
if (DocPad.generating) | |
return; | |
DocPad.generating = true; | |
path.exists(DocPad.options.srcPath, function(exists) { | |
if (!exists) | |
throw new Error('Cannot generate website as the src path does not exist, run: docpad skeleton'); | |
util.rmdir(DocPad.options.outPath,function() { | |
DocPad.generateClean(function() { | |
DocPad.generateParse(function() { | |
DocPad.generateRelations(function() { | |
DocPad.generateRender(function() { | |
DocPad.generateWrite(function() { | |
console.log('Website Generated'); | |
DocPad.generating = false; | |
if (typeof next != 'undefined') | |
next(); | |
}) }) }) }) }) | |
}); | |
}); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate | |
generate: (next) -> | |
# Check | |
if DocPad.genetating then return | |
else DocPad.generating = true | |
# Continue | |
path.exists DocPad.options.srcPath, (exists) -> | |
# Check | |
if not exists then throw Error 'Cannot generate website as the src dir was not found' | |
# Continue | |
util.rmdir DocPad.options.outPath, -> | |
DocPad.generateClean -> | |
DocPad.generateParse -> | |
DocPad.generateRelations -> | |
DocPad.generateRender -> | |
DocPad.generateWrite -> | |
console.log 'Website Generated' | |
DocPad.generating = false | |
if next then next() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Generate the Static Website | |
* 1. Clean the Database | |
* 2. Parse the Source files | |
* 3. Render the Source Files | |
*/ | |
generate: function(next){ | |
if ( DocPad.generating ) return; | |
DocPad.generating = true; | |
path.exists(DocPad.options.srcPath,function(exists){ | |
if ( !exists ) { | |
throw new Error('Cannot generate website as the src path does not exist, run: docpad skeleton'); | |
} | |
else { | |
util.rmdir(DocPad.options.outPath,function(){ | |
DocPad.generateClean(function(){ | |
DocPad.generateParse(function(){ | |
DocPad.generateRelations(function(){ | |
DocPad.generateRender(function(){ | |
DocPad.generateWrite(function(){ | |
console.log('Website Generated'); | |
DocPad.generating = false; | |
if ( next ) next(); | |
}) | |
}) | |
}) | |
}) | |
}) | |
}); | |
} | |
}); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment