From ced80fbb16455676823441ff9d2b7a5dfa25ec7d Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Wed, 8 Apr 2015 16:45:21 -0700 Subject: [PATCH] Fix example indentation --- share/html/index.hbs | 2 +- share/html/section.hbs | 8 +++----- streams/output/html.js | 10 +++++++--- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/share/html/index.hbs b/share/html/index.hbs index 21b3746..d1f323c 100644 --- a/share/html/index.hbs +++ b/share/html/index.hbs @@ -37,7 +37,7 @@
{{#each docs}} - {{> section}} +{{> section}} {{/each}}
diff --git a/share/html/section.hbs b/share/html/section.hbs index 2ec7fe4..caaa513 100644 --- a/share/html/section.hbs +++ b/share/html/section.hbs @@ -53,15 +53,13 @@ {{#if examples}}

Examples

- {{#each examples}} -
{{{.}}}
- {{/each}} +{{#each examples}}
{{{.}}}
{{/each}} {{/if}} {{#if members.instance}} {{#each members.instance}}
- {{> section}} +{{> section}}
{{/each}} {{/if}} @@ -69,7 +67,7 @@ {{#if members.static}} {{#each members.static}}
- {{> section}} +{{> section}}
{{/each}} {{/if}} diff --git a/streams/output/html.js b/streams/output/html.js index e9c7b4d..731f7e8 100644 --- a/streams/output/html.js +++ b/streams/output/html.js @@ -155,14 +155,18 @@ module.exports = function (opts) { if (type.type === 'NameExpression') { return html ? '' + autolink(type.name) + '' : type.name; } else if (type.type === 'UnionType') { - return type.elements.map(formatType).join(' or '); + return type.elements.map(function (element) { + return formatType(element, html); + }).join(' or '); } else if (type.type === 'AllLiteral') { return 'Any'; } else if (type.type === 'OptionalType') { - return '[' + formatType(type.expression) + ']'; + return '[' + formatType(type.expression, html) + ']'; } else if (type.type === 'TypeApplication') { return formatType(type.expression) + '<' + - type.applications.map(formatType).join(', ') + '>'; + type.applications.map(function (application) { + return formatType(application, html); + }).join(', ') + '>'; } }