Skip to content

Commit

Permalink
feat(pages): anchor for name of variables and functions
Browse files Browse the repository at this point in the history
  • Loading branch information
vogloblinsky committed Sep 8, 2017
1 parent 104b82f commit d9869a6
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 11 deletions.
6 changes: 6 additions & 0 deletions dist/index-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
6 changes: 6 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
6 changes: 6 additions & 0 deletions src/app/engines/html.engine.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
9 changes: 9 additions & 0 deletions src/resources/styles/compodoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion src/templates/partials/block-enum.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<tr>
<td class="col-md-4">
<a name="{{name}}"></a>
<b>{{name}}</b>
<span class="name"><b>{{name}}</b><a href="#{{name}}"><span class="fa fa-link"></span></a></span>
</td>
</tr>
{{#if description}}
Expand Down
6 changes: 3 additions & 3 deletions src/templates/partials/block-method.hbs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<section>
{{#if title}}{{else}}
{{#ifString title}}<h3>{{title}}</h3>{{else}}
<h3 id="methods">
Methods
</h3>
{{/if}}
{{/ifString}}
{{#each methods}}
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="{{name}}"></a>
<b>{{#if modifierKind}}<span class="modifier">{{modifKind modifierKind}}</span>{{/if}} {{name}}</b>
<span class="name"><b>{{#if modifierKind}}<span class="modifier">{{modifKind modifierKind}}</span>{{/if}} {{name}}</b><a href="#{{name}}"><span class="fa fa-link"></span></a></span>
</td>
</tr>
{{#if ../file-path}}
Expand Down
6 changes: 3 additions & 3 deletions src/templates/partials/block-property.hbs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<section>
{{#if title}}{{else}}
{{#ifString title}}<h3>{{title}}</h3>{{else}}
<h3 id="inputs">
Properties
</h3>
{{/if}}
{{/ifString}}
{{#each properties}}
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="{{name}}"></a>
<b>{{#if modifierKind}}<span class="modifier">{{modifKind modifierKind}}</span>{{/if}} {{name}}</b>
<span class="name"><b>{{#if modifierKind}}<span class="modifier">{{modifKind modifierKind}}</span>{{/if}} {{name}}</b><a href="#{{name}}"><span class="fa fa-link"></span></a></span>
</td>
</tr>
{{#if ../file-path}}
Expand Down
2 changes: 1 addition & 1 deletion src/templates/partials/block-typealias.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<tr>
<td class="col-md-4">
<a name="{{name}}"></a>
<b>{{name}}</b>
<span class="name"><b>{{name}}</b><a href="#{{name}}"><span class="fa fa-link"></span></a></span>
</td>
</tr>
{{#if description}}
Expand Down
2 changes: 1 addition & 1 deletion src/templates/partials/interface.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<tr>
<td class="col-md-4">
<a name="{{name}}"></a>
<b>{{name}}</b>
<span class="name"><b>{{name}}</b><a href="#{{name}}"><span class="fa fa-link"></span></a></span>
</td>
</tr>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion src/templates/partials/miscellaneous-functions.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

{{#each miscellaneous.groupedFunctions}}
<h3>{{@key}}</h3>
{{> block-method methods=this title='false'}}
{{> block-method methods=this title=''}}
{{/each}}
2 changes: 1 addition & 1 deletion src/templates/partials/miscellaneous-variables.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

{{#each miscellaneous.groupedVariables}}
<h3>{{@key}}</h3>
{{> block-property properties=this title='false'}}
{{> block-property properties=this title=''}}
{{/each}}

0 comments on commit d9869a6

Please sign in to comment.