Skip to content
Myr

docs

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

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 2f7b78c · Browse files · 4 files+39 added−31 removed
This commit

State

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

Diff stats

4 files+39 added−31 removed

  • other:+39 added−31 removed

4 files+39 added−31 removed

modified:docs/guide.1+11 added-7 removed
2001 unmodified lines
2002.2003.IP "" 02004.2005.P2006For engines that do not comply with the Express specification, we can also wrap their api this way\.2006For engines that do not comply with the Express specification, we can also wrap their api this way\. Below we map \fI\.md\fR to render markdown files, rendering the html once since it will not change on subsequent calls, and support local substitution in the form of "{name}"\.2007.2008.IP "" 42009.2010.nf20112012 app\.register(\'\.foo\', {2013 render: function(str, options) {2014 // perhaps their api is2015 // return foo\.toHTML(str, options);2016 }2017 });2012 app\.register(\'\.md\', {2013 compile: function(str, options){2014 var html = md\.toHTML(str);2015 return function(locals){2016 return html\.replace(/\e{([^}]+)\e}/g, function(_, name){2017 return locals[name];2018 });2019 };2020 }2021 });2022.2023.fi2024.2025.IP "" 0
49 unmodified lines
modified:docs/guide.html+14 added-7 removed
1502 unmodified lines
1503<pre><code> app.register('.haml', require('haml-js'));1504</code></pre>15051506<p>For engines that do not comply with the Express1507specification, we can also wrap their api this way.</p>1507specification, we can also wrap their api this way. Below1508we map <em>.md</em> to render markdown files, rendering the html once1509since it will not change on subsequent calls, and support local substitution1510in the form of "{name}".</p>15111509<pre><code> app.register('.foo', {1510 render: function(str, options) {1511 // perhaps their api is1512 // return foo.toHTML(str, options);1513 }1514 });1512<pre><code> app.register('.md', {1513 compile: function(str, options){1514 var html = md.toHTML(str);1515 return function(locals){1516 return html.replace(/\{([^}]+)\}/g, function(_, name){1517 return locals[name];1518 });1519 };1520 }1521 });1522</code></pre>15231524<h3 id="app-listen-port-host-">app.listen([port[, host]])</h3>1525
30 unmodified lines
modified:docs/guide.md+14 added-7 removed
1124 unmodified lines
11251126 app.register('.haml', require('haml-js'));11271128For engines that do not comply with the Express1129specification, we can also wrap their api this way.1129specification, we can also wrap their api this way. Below1130we map _.md_ to render markdown files, rendering the html once1131since it will not change on subsequent calls, and support local substitution1132in the form of "{name}".11331131 app.register('.foo', {1132 render: function(str, options) {1133 // perhaps their api is1134 // return foo.toHTML(str, options);1135 }1136 });1134 app.register('.md', {1135 compile: function(str, options){1136 var html = md.toHTML(str);1137 return function(locals){1138 return html.replace(/\{([^}]+)\}/g, function(_, name){1139 return locals[name];1140 });1141 };1142 }1143 });11441145### app.listen([port[, host]])11461147Bind the app server to the given _port_, which defaults to 3000. When _host_ is omitted all
20 unmodified lines
modified:lib/view/view.js-10 removed