Intentional indentation and newlines
This commit is contained in:
@@ -53,23 +53,18 @@
|
|||||||
</form>
|
</form>
|
||||||
<pre><code id="example-source" class="language-markup"><!DOCTYPE html>
|
<pre><code id="example-source" class="language-markup"><!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>{{ title }}</title>
|
<title>{{ title }}</title>
|
||||||
<link rel="stylesheet" href="http://openlayers.org/en/v{{ olVersion }}/css/ol.css" type="text/css">
|
<link rel="stylesheet" href="http://openlayers.org/en/v{{ olVersion }}/css/ol.css" type="text/css">
|
||||||
<script src="http://openlayers.org/en/v{{ olVersion }}/build/ol.js"></script>
|
<script src="http://openlayers.org/en/v{{ olVersion }}/build/ol.js"></script>{{#if extraHead.remote}}
|
||||||
{{ extraHead.remote }}
|
{{ indent extraHead.remote spaces=4 }}{{/if}}{{#if css.source}}
|
||||||
{{#if css.source}}
|
<style>
|
||||||
<style>
|
{{ indent css.source spaces=6 }} </style>{{/if}}
|
||||||
{{ css.source }}
|
</head>
|
||||||
</style>
|
<body>
|
||||||
{{/if}}
|
{{ indent contents spaces=4 }} <script>
|
||||||
</head>
|
{{ indent js.source spaces=6 }} </script>
|
||||||
<body>
|
</body>
|
||||||
{{ contents }}
|
|
||||||
<script>
|
|
||||||
{{ js.source }}
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html></code></pre>
|
</html></code></pre>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -233,6 +233,16 @@ function main(callback) {
|
|||||||
helpers: {
|
helpers: {
|
||||||
md: function(str) {
|
md: function(str) {
|
||||||
return new handlebars.SafeString(marked(str));
|
return new handlebars.SafeString(marked(str));
|
||||||
|
},
|
||||||
|
indent: function(text, options) {
|
||||||
|
if (!text) {
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
var count = options.hash.spaces || 2;
|
||||||
|
var spaces = new Array(count + 1).join(' ');
|
||||||
|
return text.split('\n').map(function(line) {
|
||||||
|
return line ? spaces + line : '';
|
||||||
|
}).join('\n');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|||||||
Reference in New Issue
Block a user