Skip to content

Commit f0a1b3f

Browse files
authored
Merge pull request #377 from hadrienk/feature/display-api-description
Display the root description of the API
2 parents fd95145 + c720276 commit f0a1b3f

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

dist/scripts/api-console.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,6 +1245,7 @@
12451245
$scope.disableThemeSwitcher = $attrs.hasOwnProperty('disableThemeSwitcher');
12461246
$scope.disableTitle = $attrs.hasOwnProperty('disableTitle');
12471247
$scope.disableTryIt = $attrs.hasOwnProperty('disableTryIt');
1248+
$scope.disableDescription = $attrs.hasOwnProperty('disableDescription');
12481249
$scope.documentationCollapsed = $attrs.hasOwnProperty('documentationCollapsed');
12491250
$scope.proxy = $window.RAML.Settings.proxy;
12501251
$scope.readResourceTraits = readResourceTraits;
@@ -7162,6 +7163,8 @@ angular.module('ramlConsoleApp').run(['$templateCache', function($templateCache)
71627163
"\n" +
71637164
" <h1 ng-if=\"!disableTitle\" class=\"raml-console-title\">{{raml.title}}</h1>\n" +
71647165
"\n" +
7166+
" <div ng-if=\"!disableDescription\" markdown=\"raml.description\"></div>\n" +
7167+
"\n" +
71657168
" <root-documentation></root-documentation>\n" +
71667169
"\n" +
71677170
" <root-types types=\"types\" ng-if=\"types\"></root-types>\n" +

src/app/directives/raml-console.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
$scope.disableThemeSwitcher = $attrs.hasOwnProperty('disableThemeSwitcher');
2626
$scope.disableTitle = $attrs.hasOwnProperty('disableTitle');
2727
$scope.disableTryIt = $attrs.hasOwnProperty('disableTryIt');
28+
$scope.disableDescription = $attrs.hasOwnProperty('disableDescription');
29+
$scope.descriptionLimit = $attrs.hasOwnProperty('descriptionLimit') || 300;
2830
$scope.documentationCollapsed = $attrs.hasOwnProperty('documentationCollapsed');
2931
$scope.proxy = $window.RAML.Settings.proxy;
3032
$scope.readResourceTraits = readResourceTraits;

src/app/directives/raml-console.tpl.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66

77
<h1 ng-if="!disableTitle" class="raml-console-title">{{raml.title}}</h1>
88

9+
10+
<div ng-if="!disableDescription" ng-init="actualSize = descriptionLimit" >
11+
<div markdown="raml.description | limitTo : actualSize"></div>
12+
<span>
13+
<a ng-click="actualSize = descriptionLimit" ng-hide="raml.description.length > actualSize || raml.description.length < actualSize" style="cursor: default;">show less</a>
14+
<a ng-click="actualSize = raml.description.length" ng-hide="raml.description.length == actualSize" style="cursor: default;">show more</a>
15+
</span>
16+
</div>
17+
918
<root-documentation></root-documentation>
1019

1120
<root-types types="types" ng-if="types"></root-types>

0 commit comments

Comments
 (0)