Skip to content
Myr

Add JSHTML template engine for cli helper

Before adoption: this commit came in with the history the project adopted, so no landing records it.

JSHTML is a express compatible template engine with very nice syntax. https://github.com/LuvDaSun/jshtml

authored by Jonathan Dumaine · committed by Jonathan Dumaine · parent 72fab80 · Browse files · 1 file+33 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • https: //github.com/LuvDaSun/jshtml

Diff stats

1 file+33 added−0 removed

  • other:+33 added−0 removed

1 file+33 added−0 removed

modified:bin/express+33 added
13 unmodified lines
14program15 .version(express.version)16 .option('-s, --sessions', 'add session support')17 .option('-e, --ejs', 'add ejs support (defaults to jade)')18 .option('-J, --jshtml', 'add jshtml support (defaults to jade)')19 .option('-S, --stylus', 'add stylus support')20 .parse(process.argv);2122// Path
3 unmodified lines
26// Template engine2728program.template = 'jade';29if (program.ejs) program.template = 'ejs';30if (program.jshtml) program.template = 'jshtml';3132// Stylesheet engine3334program.css = program.stylus
48 unmodified lines
83 , '<p>Welcome to <%= title %></p>'84 ].join('\n');8586/**87 * JSHTML layout template.88 */8990var jshtmlLayout = [91 '<!DOCTYPE html>'92 , '<html>'93 , ' <head>'94 , ' <title> @write(title) </title>'95 , ' <link rel=\'stylesheet\' href=\'/stylesheets/style.css\' />'96 , ' </head>'97 , ' <body>'98 , ' @write(body)'99 , ' </body>'100 , '</html>'101].join('\n');102103/**104 * JSHTML index template.105 */106107var jshtmlIndex = [108 '<h1>@write(title)</h1>'109 , '<p>Welcome to @write(title)</p>'110 ].join('\n');111112/**113 * Default css template.114 */115116var css = [
147 unmodified lines
264 case 'jade':265 write(path + '/views/layout.jade', jadeLayout);266 write(path + '/views/index.jade', jadeIndex);267 break;268 case 'jshtml':269 write(path + '/views/layout.jshtml', jshtmlLayout);270 write(path + '/views/index.jshtml', jshtmlIndex);271 break;272273 }274 });275276 // CSS Engine support
89 unmodified lines