From 4e687079c135108a8d2c1f2f8762c9267bbaf77e Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Mon, 6 Jul 2015 17:28:43 -0400 Subject: [PATCH] docs: show nullable and array params properly --- docs/site/components/docs/docs.html | 5 ++++- docs/site/components/docs/docs.js | 14 ++++++++++++-- docs/site/css/main.css | 16 +++++++++++++--- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/docs/site/components/docs/docs.html b/docs/site/components/docs/docs.html index 0b5d4c650ce3..e271a5bb5d9d 100644 --- a/docs/site/components/docs/docs.html +++ b/docs/site/components/docs/docs.html @@ -83,7 +83,10 @@

Parameters

+ ng-class="{ + 'param-optional': param.optional, + 'param-nullable': param.nullable + }">
{{param.name.split('.').slice(0, -1).join('.')}}
diff --git a/docs/site/components/docs/docs.js b/docs/site/components/docs/docs.js index c166986a09d5..166c97cb0d99 100644 --- a/docs/site/components/docs/docs.js +++ b/docs/site/components/docs/docs.js @@ -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; diff --git a/docs/site/css/main.css b/docs/site/css/main.css index 862f8e3b5817..9dab20ad74ae 100755 --- a/docs/site/css/main.css +++ b/docs/site/css/main.css @@ -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; }