Skip to content

Commit

Permalink
docs: show nullable and array params properly
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus committed Jul 6, 2015
1 parent 85886f4 commit 4e68707
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
5 changes: 4 additions & 1 deletion docs/site/components/docs/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ <h4 ng-show="method.params">Parameters</h4>
<tbody>
<tr
ng-repeat="param in method.params"
ng-class="{ 'param-optional': param.optional }">
ng-class="{
'param-optional': param.optional,
'param-nullable': param.nullable
}">
<th scope="row" class="param">
<span ng-if="param.subparam" class="param-parent">
<div>{{param.name.split('.').slice(0, -1).join('.')}}</div>
Expand Down
14 changes: 12 additions & 2 deletions docs/site/components/docs/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,19 @@ angular
'bucket',
'file',
'job',
'table'
'table',
'index',
'document',
'field',
'topic',
'subscription'
];
type = type.replace('=', '');

var arrayRegex = /Array\.<([^>]+)>/g;
type = type.replace('=', '')
.replace('?', '')
.replace(arrayRegex, '$1[]');

if (CUSTOM_TYPES.indexOf(type.toLowerCase()) > -1) {
if (types[index - 1]) {
type = types[index - 1] + '/' + type;
Expand Down
16 changes: 13 additions & 3 deletions docs/site/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -856,17 +856,27 @@ ul {
padding-top: 0.7em;
}

.param-optional .param-types {
.param-optional .param-types,
.param-nullable .param-types {
font-style: italic;
}

.param-optional .param-types:after {
content: " (optional)";
.param-optional .param-types:after,
.param-nullable .param-types:after {
display: block;
color: #aaa;
font-style: italic;
font-size: 85%;
}

.param-optional .param-types:after {
content: " (optional)";
}

.param-nullable .param-types:after {
content: " (may be null)";
}

.method-heading {
position: relative;
}
Expand Down

0 comments on commit 4e68707

Please sign in to comment.