Skip to content

Commit a26e978

Browse files
author
Javier Centurion
committed
Fix resource level documentation for childnodes
1 parent 07f772c commit a26e978

File tree

10 files changed

+72
-63
lines changed

10 files changed

+72
-63
lines changed

dist/examples/leagues.raml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ securedBy: [ basic, digest_auth, oauth_2_0 ]
318318
319319
/{teamId}:
320320
displayName: Team
321-
#description: |
322-
# The team is the basic unit for keeping track of a roster of players that are participating together in La Liga. With the Team APIs, you can obtain team-related information, like the team name, stats, points, and more.
321+
description: |
322+
The team is the basic unit for keeping track of a roster of players that are participating together in La Liga. With the Team APIs, you can obtain team-related information, like the team name, stats, points, and more.
323323
uriParameters:
324324
teamId:
325325
description: |

dist/scripts/api-console-vendor.js

Lines changed: 38 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var block = {
2020
lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,
2121
blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,
2222
list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
23-
html: /^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,
23+
html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,
2424
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,
2525
table: noop,
2626
paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,
@@ -868,7 +868,7 @@ Renderer.prototype.link = function(href, title, text) {
868868
} catch (e) {
869869
return '';
870870
}
871-
if (prot.indexOf('javascript:') === 0) {
871+
if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0) {
872872
return '';
873873
}
874874
}
@@ -1154,8 +1154,13 @@ function marked(src, opt, callback) {
11541154

11551155
pending = tokens.length;
11561156

1157-
var done = function() {
1158-
var out, err;
1157+
var done = function(err) {
1158+
if (err) {
1159+
opt.highlight = highlight;
1160+
return callback(err);
1161+
}
1162+
1163+
var out;
11591164

11601165
try {
11611166
out = Parser.parse(tokens, opt);
@@ -1184,6 +1189,7 @@ function marked(src, opt, callback) {
11841189
return --pending || done();
11851190
}
11861191
return highlight(token.text, token.lang, function(err, code) {
1192+
if (err) return done(err);
11871193
if (code == null || code === token.text) {
11881194
return --pending || done();
11891195
}
@@ -1253,7 +1259,7 @@ marked.inlineLexer = InlineLexer.output;
12531259

12541260
marked.parse = marked;
12551261

1256-
if (typeof exports === 'object') {
1262+
if (typeof module !== 'undefined' && typeof exports === 'object') {
12571263
module.exports = marked;
12581264
} else if (typeof define === 'function' && define.amd) {
12591265
define(function() { return marked; });
@@ -40225,7 +40231,7 @@ CodeMirror.defineMIME("text/x-yaml", "yaml");
4022540231
})();
4022640232

4022740233
/**
40228-
* @license AngularJS v1.2.28
40234+
* @license AngularJS v1.2.29-build.590+sha.e81b2f7
4022940235
* (c) 2010-2014 Google, Inc. http://angularjs.org
4023040236
* License: MIT
4023140237
*/
@@ -40294,7 +40300,7 @@ function minErr(module) {
4029440300
return match;
4029540301
});
4029640302

40297-
message = message + '\nhttp://errors.angularjs.org/1.2.28/' +
40303+
message = message + '\nhttp://errors.angularjs.org/1.2.29-build.590+sha.e81b2f7/' +
4029840304
(module ? module + '/' : '') + code;
4029940305
for (i = 2; i < arguments.length; i++) {
4030040306
message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +
@@ -40708,6 +40714,8 @@ noop.$inject = [];
4070840714
return (transformationFn || angular.identity)(value);
4070940715
};
4071040716
```
40717+
* @param {*} value to be returned.
40718+
* @returns {*} the value passed in.
4071140719
*/
4071240720
function identity($) {return $;}
4071340721
identity.$inject = [];
@@ -42213,11 +42221,11 @@ function setupModuleLoader(window) {
4221342221
* - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
4221442222
*/
4221542223
var version = {
42216-
full: '1.2.28', // all of these placeholder strings will be replaced by grunt's
42224+
full: '1.2.29-build.590+sha.e81b2f7', // all of these placeholder strings will be replaced by grunt's
4221742225
major: 1, // package task
4221842226
minor: 2,
42219-
dot: 28,
42220-
codeName: 'finnish-disembarkation'
42227+
dot: 29,
42228+
codeName: 'snapshot'
4222142229
};
4222242230

4222342231

@@ -44649,6 +44657,11 @@ function Browser(window, document, $log, $sniffer) {
4464944657
}
4465044658
}
4465144659

44660+
function getHash(url) {
44661+
var index = url.indexOf('#');
44662+
return index === -1 ? '' : url.substr(index + 1);
44663+
}
44664+
4465244665
/**
4465344666
* @private
4465444667
* Note: this method is used only by scenario runner
@@ -44760,8 +44773,10 @@ function Browser(window, document, $log, $sniffer) {
4476044773
}
4476144774
if (replace) {
4476244775
location.replace(url);
44763-
} else {
44776+
} else if (!sameBase) {
4476444777
location.href = url;
44778+
} else {
44779+
location.hash = getHash(url);
4476544780
}
4476644781
}
4476744782
return self;
@@ -49516,6 +49531,10 @@ function stripHash(url) {
4951649531
return index == -1 ? url : url.substr(0, index);
4951749532
}
4951849533

49534+
function trimEmptyHash(url) {
49535+
return url.replace(/(#.+)|#$/, '$1');
49536+
}
49537+
4951949538

4952049539
function stripFile(url) {
4952149540
return url.substr(0, stripHash(url).lastIndexOf('/') + 1);
@@ -50172,10 +50191,11 @@ function $LocationProvider(){
5017250191
// update browser
5017350192
var changeCounter = 0;
5017450193
$rootScope.$watch(function $locationWatch() {
50175-
var oldUrl = $browser.url();
50194+
var oldUrl = trimEmptyHash($browser.url());
50195+
var newUrl = trimEmptyHash($location.absUrl());
5017650196
var currentReplace = $location.$$replace;
5017750197

50178-
if (!changeCounter || oldUrl != $location.absUrl()) {
50198+
if (!changeCounter || oldUrl != newUrl) {
5017950199
changeCounter++;
5018050200
$rootScope.$evalAsync(function() {
5018150201
if ($rootScope.$broadcast('$locationChangeStart', $location.absUrl(), oldUrl).
@@ -55774,37 +55794,12 @@ function limitToFilter(){
5577455794
limit = int(limit);
5577555795
}
5577655796

55777-
if (isString(input)) {
55778-
//NaN check on limit
55779-
if (limit) {
55780-
return limit >= 0 ? input.slice(0, limit) : input.slice(limit, input.length);
55781-
} else {
55782-
return "";
55783-
}
55784-
}
55785-
55786-
var out = [],
55787-
i, n;
55788-
55789-
// if abs(limit) exceeds maximum length, trim it
55790-
if (limit > input.length)
55791-
limit = input.length;
55792-
else if (limit < -input.length)
55793-
limit = -input.length;
55794-
55795-
if (limit > 0) {
55796-
i = 0;
55797-
n = limit;
55797+
//NaN check on limit
55798+
if (limit) {
55799+
return limit > 0 ? input.slice(0, limit) : input.slice(limit);
5579855800
} else {
55799-
i = input.length + limit;
55800-
n = input.length;
55801+
return isString(input) ? "" : [];
5580155802
}
55802-
55803-
for (; i<n; i++) {
55804-
out.push(input[i]);
55805-
}
55806-
55807-
return out;
5580855803
};
5580955804
}
5581055805

@@ -60077,7 +60072,7 @@ var ngIfDirective = ['$animate', function($animate) {
6007760072
<select ng-model="template" ng-options="t.name for t in templates">
6007860073
<option value="">(blank)</option>
6007960074
</select>
60080-
url of the template: <tt>{{template.url}}</tt>
60075+
url of the template: <code>{{template.url}}</code>
6008160076
<hr/>
6008260077
<div class="slide-animate-container">
6008360078
<div class="slide-animate" ng-include="template.url"></div>

dist/scripts/api-console.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5269,7 +5269,7 @@ angular.module('ramlConsoleApp').run(['$templateCache', function($templateCache)
52695269
" <li ng-repeat=\"header in content\" class=\"raml-console-resource-list-item\">\n" +
52705270
" <div class=\"raml-console-resource raml-console-clearfix raml-console-documentation-clearfix\">\n" +
52715271
" <div class=\"raml-console-resource-path-container raml-console-documentation-path-container\">\n" +
5272-
" <h3 class=\"raml-console-resource-heading raml-console-md-heading-{{header.heading}}\">\n" +
5272+
" <h3 class=\"raml-console-resource-heading raml-console-documentation-heading raml-console-md-heading-{{header.heading}}\">\n" +
52735273
" <div class=\"raml-console-resource-path-active\">\n" +
52745274
" <div class=\"raml-consoledocumentation-title\" ng-click=\"showSection($event, header.value, doc.title)\">{{header.label}}</div>\n" +
52755275
" </div>\n" +
@@ -5552,7 +5552,7 @@ angular.module('ramlConsoleApp').run(['$templateCache', function($templateCache)
55525552
" <li id=\"{{generateId(resource.pathSegments)}}\" class=\"raml-console-resource-list-item\" ng-repeat=\"resource in resourceGroup\" ng-if=\"!$first\">\n" +
55535553
" <div class=\"raml-console-resource raml-console-clearfix\" ng-class=\"{ 'raml-console-is-active':showPanel }\">\n" +
55545554
" <div class=\"raml-console-resource-path-container\">\n" +
5555-
" <h3 class=\"raml-console-resource-heading\">\n" +
5555+
" <h3 class=\"raml-console-resource-heading\" ng-click=\"showResourceDescription($event)\" ng-class=\"{'raml-console-resource-heading-hover':resource.description}\">\n" +
55565556
" <span ng-repeat-start='segment in resource.pathSegments' ng-if=\"!$last\">{{segment.toString()}}</span><span ng-repeat-end ng-if=\"$last\" class=\"raml-console-resource-path-active\">{{segment.toString()}}</span>\n" +
55575557
" </h3>\n" +
55585558
"\n" +
@@ -5564,6 +5564,13 @@ angular.module('ramlConsoleApp').run(['$templateCache', function($templateCache)
55645564
" <close-button></close-button>\n" +
55655565
" </div>\n" +
55665566
"\n" +
5567+
" <span class=\"raml-console-resource-list-item raml-console-resource-description\" ng-show=\"resourceGroup.length > 1\" ng-if=\"resource.description\">\n" +
5568+
" <div class=\"raml-console-resource-panel-primary-row raml-console-resource-panel-content raml-console-is-active\">\n" +
5569+
" <h3 class=\"raml-console-resource-heading-a\">Description</h3>\n" +
5570+
" <p marked=\"resource.description\" opts=\"markedOptions\"></p>\n" +
5571+
" </div>\n" +
5572+
" </span>\n" +
5573+
"\n" +
55675574
" <resource-panel></resource-panel>\n" +
55685575
" </li>\n" +
55695576
" </ol>\n" +

dist/styles/api-console-dark-theme.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2096,10 +2096,6 @@ ol.raml-console-resources-container {
20962096
}
20972097
}
20982098

2099-
span.raml-console-resource-path-active {
2100-
cursor: default;
2101-
}
2102-
21032099
a.raml-console-resource-path-active {
21042100
cursor: pointer;
21052101
}
@@ -4152,6 +4148,10 @@ span.raml-console-side-bar-required-field {
41524148
}
41534149
}
41544150

4151+
.raml-console-documentation-heading:hover {
4152+
cursor: pointer;
4153+
}
4154+
41554155
.raml-console-documentation-header {
41564156
background: #252f3f;
41574157
position: relative;

dist/styles/api-console-light-theme.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2096,10 +2096,6 @@ ol.raml-console-resources-container {
20962096
}
20972097
}
20982098

2099-
span.raml-console-resource-path-active {
2100-
cursor: default;
2101-
}
2102-
21032099
a.raml-console-resource-path-active {
21042100
cursor: pointer;
21052101
}
@@ -4152,6 +4148,10 @@ span.raml-console-side-bar-required-field {
41524148
}
41534149
}
41544150

4151+
.raml-console-documentation-heading:hover {
4152+
cursor: pointer;
4153+
}
4154+
41554155
.raml-console-documentation-header {
41564156
background: #e0e0e0;
41574157
position: relative;

src/app/directives/root-documentation.tpl.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ <h3 class="raml-console-resource-heading">
3838
<li ng-repeat="header in content" class="raml-console-resource-list-item">
3939
<div class="raml-console-resource raml-console-clearfix raml-console-documentation-clearfix">
4040
<div class="raml-console-resource-path-container raml-console-documentation-path-container">
41-
<h3 class="raml-console-resource-heading raml-console-md-heading-{{header.heading}}">
41+
<h3 class="raml-console-resource-heading raml-console-documentation-heading raml-console-md-heading-{{header.heading}}">
4242
<div class="raml-console-resource-path-active">
4343
<div class="raml-consoledocumentation-title" ng-click="showSection($event, header.value, doc.title)">{{header.label}}</div>
4444
</div>

src/app/resources/resources.tpl.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ <h3 class="raml-console-resource-heading-a">Description</h3>
7171
<li id="{{generateId(resource.pathSegments)}}" class="raml-console-resource-list-item" ng-repeat="resource in resourceGroup" ng-if="!$first">
7272
<div class="raml-console-resource raml-console-clearfix" ng-class="{ 'raml-console-is-active':showPanel }">
7373
<div class="raml-console-resource-path-container">
74-
<h3 class="raml-console-resource-heading">
74+
<h3 class="raml-console-resource-heading" ng-click="showResourceDescription($event)" ng-class="{'raml-console-resource-heading-hover':resource.description}">
7575
<span ng-repeat-start='segment in resource.pathSegments' ng-if="!$last">{{segment.toString()}}</span><span ng-repeat-end ng-if="$last" class="raml-console-resource-path-active">{{segment.toString()}}</span>
7676
</h3>
7777

@@ -83,6 +83,13 @@ <h3 class="raml-console-resource-heading">
8383
<close-button></close-button>
8484
</div>
8585

86+
<span class="raml-console-resource-list-item raml-console-resource-description" ng-show="resourceGroup.length > 1" ng-if="resource.description">
87+
<div class="raml-console-resource-panel-primary-row raml-console-resource-panel-content raml-console-is-active">
88+
<h3 class="raml-console-resource-heading-a">Description</h3>
89+
<p marked="resource.description" opts="markedOptions"></p>
90+
</div>
91+
</span>
92+
8693
<resource-panel></resource-panel>
8794
</li>
8895
</ol>

src/assets/examples/leagues.raml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ securedBy: [ basic, digest_auth, oauth_2_0 ]
318318
319319
/{teamId}:
320320
displayName: Team
321-
#description: |
322-
# The team is the basic unit for keeping track of a roster of players that are participating together in La Liga. With the Team APIs, you can obtain team-related information, like the team name, stats, points, and more.
321+
description: |
322+
The team is the basic unit for keeping track of a roster of players that are participating together in La Liga. With the Team APIs, you can obtain team-related information, like the team name, stats, points, and more.
323323
uriParameters:
324324
teamId:
325325
description: |

src/scss/_documentation.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555
}
5656
}
5757

58+
.documentation-heading:hover {
59+
cursor: pointer;
60+
}
61+
5862
.documentation-header {
5963
background: $color-console-documentation-header;
6064
position: relative;

src/scss/_resource.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,6 @@ ol.resources-container {
344344
}
345345
}
346346

347-
span.resource-path-active {
348-
cursor: default;
349-
}
350-
351347
a.resource-path-active {
352348
cursor: pointer;
353349
}

0 commit comments

Comments
 (0)