Skip to content

Commit f833b3b

Browse files
Merge pull request #521 from ryanseys/links-to-github
Add links to code on GitHub
2 parents 686fe62 + b530bd1 commit f833b3b

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

docs/site/components/docs/docs.html

+2
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ <h4 ng-show="method.returns">Returns</h4>
147147
<h4 ng-show="method.example">Example</h4>
148148
<div docs-example ng-repeat-end
149149
ng-show="method.example" ng-bind-html="method.example"></div>
150+
<div class="view-code-link">View the code
151+
<a href="https://github.com/GoogleCloudPlatform/gcloud-node/blob/{{version}}/lib/{{module ? module + '/' : ''}}{{class}}.js{{method.lineNumLink}}">on GitHub</a>.</div>
150152
<hr ng-if="$index < methods.length - 1">
151153
</article>
152154
</article>

docs/site/components/docs/docs.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ angular
135135
if (alias && alias.string.indexOf('module:') !== 0) {
136136
alias = alias.string;
137137
} else {
138-
alias = false
138+
alias = false;
139139
}
140140

141141
return {
@@ -149,6 +149,8 @@ angular
149149
}),
150150
description: $sce.trustAsHtml(
151151
formatHtml(detectLinks(detectModules(obj.description.full)))),
152+
lineNum: obj.codeStart,
153+
lineNumLink: obj.codeStart ? '#L' + obj.codeStart : '',
152154
params: obj.tags.filter(function(tag) {
153155
return tag.type === 'param';
154156
})
@@ -334,6 +336,7 @@ angular
334336
$scope.activeUrl = '#' + $location.path();
335337
$scope.singleMethod = methods.singleMethod;
336338
$scope.module = $routeParams.module;
339+
$scope.class = $routeParams.class || 'index';
337340
$scope.methods = methods;
338341
$scope.version = $routeParams.version;
339342
$scope.versions = versions;

docs/site/css/main.css

+4
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,10 @@ ul {
732732
background: #F8F8F8;
733733
}
734734

735+
.view-code-link {
736+
color: #888;
737+
}
738+
735739
/*
736740
Page Title
737741
*/

0 commit comments

Comments
 (0)