javascript:jade
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
javascript:jade [2014/03/18 03:30] – [Creating an HTML fragment] mithat | javascript:jade [2014/03/18 03:36] – [Creating web pages] mithat | ||
---|---|---|---|
Line 162: | Line 162: | ||
}; | }; | ||
- | // Render an HTML page from a file | + | // Render an HTML page from a file written in Jade. |
- | // written in Jade. | + | var html = jade.renderFile(' |
- | var html = jade.renderFile(' | + | if (err) { |
+ | | ||
+ | } | ||
+ | return html; | ||
+ | }); | ||
// Write HTML to a file. | // Write HTML to a file. | ||
- | fs.writeFile(' | + | fs.writeFile(' |
+ | if (err) { | ||
+ | throw(err); | ||
+ | } | ||
+ | }); | ||
</ | </ | ||
Line 184: | Line 192: | ||
</ | </ | ||
- | The basic idea is that Jade uses a shorthand HTML syntax, and indentation is used to nest elements. | + | The basic idea is that Jade uses a shorthand HTML syntax |
This should be enough to make you comfortable reading the [[http:// | This should be enough to make you comfortable reading the [[http:// | ||
- | |||
- | <WRAP center round info 60%> | ||
- | More later, time permitting. | ||
- | </ | ||
- | |||