From d9869a6f6b77d154bb146f84a270e02f612aed5d Mon Sep 17 00:00:00 2001 From: vogloblinsky Date: Fri, 8 Sep 2017 10:47:51 +0200 Subject: [PATCH] feat(pages): anchor for name of variables and functions --- dist/index-cli.js | 6 ++++++ dist/index.js | 6 ++++++ src/app/engines/html.engine.helpers.ts | 6 ++++++ src/resources/styles/compodoc.css | 9 +++++++++ src/templates/partials/block-enum.hbs | 2 +- src/templates/partials/block-method.hbs | 6 +++--- src/templates/partials/block-property.hbs | 6 +++--- src/templates/partials/block-typealias.hbs | 2 +- src/templates/partials/interface.hbs | 2 +- src/templates/partials/miscellaneous-functions.hbs | 2 +- src/templates/partials/miscellaneous-variables.hbs | 2 +- 11 files changed, 38 insertions(+), 11 deletions(-) diff --git a/dist/index-cli.js b/dist/index-cli.js index 7086969d..7b7b90b5 100644 --- a/dist/index-cli.js +++ b/dist/index-cli.js @@ -860,6 +860,12 @@ var HtmlEngineHelpers = (function () { } return options.inverse(this); }); + Handlebars.registerHelper("ifString", function (a, options) { + if (typeof a === 'string') { + return options.fn(this); + } + return options.inverse(this); + }); Handlebars.registerHelper("orLength", function () { var len = arguments.length - 1; var options = arguments[len]; diff --git a/dist/index.js b/dist/index.js index e044bcf7..6e8e488c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -860,6 +860,12 @@ var HtmlEngineHelpers = (function () { } return options.inverse(this); }); + Handlebars.registerHelper("ifString", function (a, options) { + if (typeof a === 'string') { + return options.fn(this); + } + return options.inverse(this); + }); Handlebars.registerHelper("orLength", function () { var len = arguments.length - 1; var options = arguments[len]; diff --git a/src/app/engines/html.engine.helpers.ts b/src/app/engines/html.engine.helpers.ts index 9f116298..201da287 100644 --- a/src/app/engines/html.engine.helpers.ts +++ b/src/app/engines/html.engine.helpers.ts @@ -54,6 +54,12 @@ export let HtmlEngineHelpers = (function() { return options.inverse(this); }); + Handlebars.registerHelper("ifString", function(a, options) { + if (typeof a === 'string') { + return options.fn(this); + } + return options.inverse(this); + }); Handlebars.registerHelper("orLength", function(/* any, any, ..., options */) { var len = arguments.length - 1; var options = arguments[len]; diff --git a/src/resources/styles/compodoc.css b/src/resources/styles/compodoc.css index ae413a2f..c3bfd7c2 100644 --- a/src/resources/styles/compodoc.css +++ b/src/resources/styles/compodoc.css @@ -757,3 +757,12 @@ ul.index-list { height: 175px; line-height: 175px; } + +.name a { + display: none; + color: #6e6e6e; + margin-left: 5px; +} +.name:hover a { + display: inline-block; +} diff --git a/src/templates/partials/block-enum.hbs b/src/templates/partials/block-enum.hbs index 64c184c1..905a81aa 100644 --- a/src/templates/partials/block-enum.hbs +++ b/src/templates/partials/block-enum.hbs @@ -5,7 +5,7 @@ - {{name}} + {{name}} {{#if description}} diff --git a/src/templates/partials/block-method.hbs b/src/templates/partials/block-method.hbs index a9f32041..a4aa437a 100644 --- a/src/templates/partials/block-method.hbs +++ b/src/templates/partials/block-method.hbs @@ -1,16 +1,16 @@
- {{#if title}}{{else}} + {{#ifString title}}

{{title}}

{{else}}

Methods

- {{/if}} + {{/ifString}} {{#each methods}} {{#if ../file-path}} diff --git a/src/templates/partials/block-property.hbs b/src/templates/partials/block-property.hbs index 5b3e065c..74d72603 100644 --- a/src/templates/partials/block-property.hbs +++ b/src/templates/partials/block-property.hbs @@ -1,16 +1,16 @@
- {{#if title}}{{else}} + {{#ifString title}}

{{title}}

{{else}}

Properties

- {{/if}} + {{/ifString}} {{#each properties}}
- {{#if modifierKind}}{{modifKind modifierKind}}{{/if}} {{name}} + {{#if modifierKind}}{{modifKind modifierKind}}{{/if}} {{name}}
{{#if ../file-path}} diff --git a/src/templates/partials/block-typealias.hbs b/src/templates/partials/block-typealias.hbs index 7f92b2b6..cd6dcad6 100644 --- a/src/templates/partials/block-typealias.hbs +++ b/src/templates/partials/block-typealias.hbs @@ -5,7 +5,7 @@ {{#if description}} diff --git a/src/templates/partials/interface.hbs b/src/templates/partials/interface.hbs index 5e6213c2..dce7ad2c 100644 --- a/src/templates/partials/interface.hbs +++ b/src/templates/partials/interface.hbs @@ -116,7 +116,7 @@ diff --git a/src/templates/partials/miscellaneous-functions.hbs b/src/templates/partials/miscellaneous-functions.hbs index f9e2a416..7d313536 100644 --- a/src/templates/partials/miscellaneous-functions.hbs +++ b/src/templates/partials/miscellaneous-functions.hbs @@ -6,5 +6,5 @@ {{#each miscellaneous.groupedFunctions}}

{{@key}}

- {{> block-method methods=this title='false'}} + {{> block-method methods=this title=''}} {{/each}} diff --git a/src/templates/partials/miscellaneous-variables.hbs b/src/templates/partials/miscellaneous-variables.hbs index 48295957..51b2b05d 100644 --- a/src/templates/partials/miscellaneous-variables.hbs +++ b/src/templates/partials/miscellaneous-variables.hbs @@ -6,5 +6,5 @@ {{#each miscellaneous.groupedVariables}}

{{@key}}

- {{> block-property properties=this title='false'}} + {{> block-property properties=this title=''}} {{/each}}
- {{#if modifierKind}}{{modifKind modifierKind}}{{/if}} {{name}} + {{#if modifierKind}}{{modifKind modifierKind}}{{/if}} {{name}}
- {{name}} + {{name}}
- {{name}} + {{name}}