-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f995f8
commit 68848aa
Showing
18 changed files
with
3,192 additions
and
625 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
angular.module('gcloud.docs') | ||
.factory('getLinks', function(pages, versions) { | ||
return function(version) { | ||
var baseUrl = '#/docs/' + version; | ||
var VERSIONS = pages.VERSIONS; | ||
if (!version || version === 'master') { | ||
var versions = Object.keys(VERSIONS); | ||
match = versions[versions.length - 1]; | ||
} else { | ||
match = Object.keys(VERSIONS).filter(semver.satisfies.bind(null, version))[0]; | ||
} | ||
return VERSIONS[match] | ||
.map(function(module) { | ||
if (pages[module]._url) { | ||
pages[module].url = pages[module]._url.replace('{baseUrl}', baseUrl); | ||
} | ||
return pages[module]; | ||
}); | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
angular.module('gcloud.docs') | ||
.value('pages', { | ||
gcloud: { | ||
title: 'gcloud', | ||
_url: '{baseUrl}' | ||
}, | ||
|
||
datastore: { | ||
title: 'Datastore', | ||
_url: '{baseUrl}/datastore', | ||
pages: [ | ||
{ | ||
title: 'Dataset', | ||
url: '/dataset' | ||
}, | ||
{ | ||
title: 'Query', | ||
url: '/query' | ||
} | ||
] | ||
}, | ||
|
||
pubsub: { | ||
title: 'PubSub', | ||
_url: '{baseUrl}/pubsub', | ||
pages: [ | ||
{ | ||
title: 'Topic', | ||
url: '/topic' | ||
}, | ||
{ | ||
title: 'Subscription', | ||
url: '/subscription' | ||
} | ||
] | ||
}, | ||
|
||
storage: { | ||
title: 'Storage', | ||
_url: '{baseUrl}/storage' | ||
}, | ||
|
||
VERSIONS: { | ||
// Give a version with/without a comparator, anything semver: | ||
// https://github.com/npm/node-semver#versions | ||
// List should be in ascending order. | ||
'<=0.7.1': ['gcloud', 'datastore', 'storage'], | ||
'>0.7.1': ['gcloud', 'datastore', 'pubsub', 'storage'] | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.