Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add links to code on GitHub #521

Merged
merged 1 commit into from
May 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/site/components/docs/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ <h4 ng-show="method.returns">Returns</h4>
<h4 ng-show="method.example">Example</h4>
<div docs-example ng-repeat-end
ng-show="method.example" ng-bind-html="method.example"></div>
<div class="view-code-link">View the code
<a href="https://github.com/GoogleCloudPlatform/gcloud-node/blob/{{version}}/lib/{{module ? module + '/' : ''}}{{class}}.js{{method.lineNumLink}}">on GitHub</a>.</div>
<hr ng-if="$index < methods.length - 1">
</article>
</article>
Expand Down
5 changes: 4 additions & 1 deletion docs/site/components/docs/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ angular
if (alias && alias.string.indexOf('module:') !== 0) {
alias = alias.string;
} else {
alias = false
alias = false;
}

return {
Expand All @@ -149,6 +149,8 @@ angular
}),
description: $sce.trustAsHtml(
formatHtml(detectLinks(detectModules(obj.description.full)))),
lineNum: obj.codeStart,
lineNumLink: obj.codeStart ? '#L' + obj.codeStart : '',

This comment was marked as spam.

This comment was marked as spam.

params: obj.tags.filter(function(tag) {
return tag.type === 'param';
})
Expand Down Expand Up @@ -334,6 +336,7 @@ angular
$scope.activeUrl = '#' + $location.path();
$scope.singleMethod = methods.singleMethod;
$scope.module = $routeParams.module;
$scope.class = $routeParams.class || 'index';
$scope.methods = methods;
$scope.version = $routeParams.version;
$scope.versions = versions;
Expand Down
4 changes: 4 additions & 0 deletions docs/site/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,10 @@ ul {
background: #F8F8F8;
}

.view-code-link {
color: #888;
}

/*
Page Title
*/
Expand Down