-
Notifications
You must be signed in to change notification settings - Fork 591
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
bee6ed1
commit 2423211
Showing
13 changed files
with
1,875 additions
and
684 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,12 @@ | ||
angular.module('gcloud.docs') | ||
.directive('docsExample', function($compile) { | ||
'use strict'; | ||
|
||
return { | ||
link: function(scope, element, attr) { | ||
scope.$watch(attr.ngBindHtml, function() { | ||
$compile(element.contents())(scope); | ||
}, true); | ||
} | ||
}; | ||
}); |
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,24 @@ | ||
angular.module('gcloud.docs') | ||
.factory('getLinks', function(pages) { | ||
'use strict'; | ||
|
||
return function(version) { | ||
var baseUrl = '#/docs/' + version; | ||
var VERSIONS = pages.VERSIONS; | ||
var versions; | ||
var match; | ||
if (!version || version === 'master') { | ||
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,54 @@ | ||
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' | ||
} | ||
] | ||
}, | ||
|
||
datastoreWithTransaction: { | ||
title: 'Datastore', | ||
_url: '{baseUrl}/datastore', | ||
pages: [ | ||
{ | ||
title: 'Dataset', | ||
url: '/dataset' | ||
}, | ||
{ | ||
title: 'Transaction', | ||
url: '/transaction' | ||
}, | ||
{ | ||
title: 'Query', | ||
url: '/query' | ||
} | ||
] | ||
}, | ||
|
||
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', 'datastoreWithTransaction', '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.