Skip to content

Commit

Permalink
Fix docs for restructure (#966)
Browse files Browse the repository at this point in the history
* Fix docs for restructure

* only show docs for bigquerydatatransfer v0.3.0+
  • Loading branch information
dwsupplee authored and jdpedrie committed Mar 28, 2018
1 parent 1ced0b7 commit be4ce7f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
23 changes: 9 additions & 14 deletions dev/src/DocGenerator/DocGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,25 +98,20 @@ public function generate($basePath, $pretty)
if ($document) {
$writer = new Writer($document, $this->outputPath, $pretty);
$writer->write($currentFile);
$pathInfo = pathinfo($currentFile);
$servicePath = $pathInfo['dirname'] === '.'
? strtolower($pathInfo['filename'])
: strtolower($pathInfo['dirname'] . '/' . $pathInfo['filename']);
$id = $this->isComponent
? strtolower($basePath) . '/' . $servicePath
: $servicePath;

$this->types->addType([
'id' => $document['id'],
'id' => $id,
'title' => $document['title'],
'contents' => ($this->isComponent)
? $this->prune($document['id'] . '.json')
: $document['id'] . '.json'
'contents' => $servicePath . '.json'
]);
}
}
}

private function prune($contentsFileName)
{
$explode = explode('/', $contentsFileName);
if (count($explode) > 1) {
array_shift($explode);
}

return implode('/', $explode);
}
}
4 changes: 1 addition & 3 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
"id": "google-cloud",
"name": "google/cloud",
"defaultService": "readme",
"defaultService": "servicebuilder",
"versions": [
"v0.58.0",
"v0.57.1",
Expand Down Expand Up @@ -119,8 +119,6 @@
"defaultService": "bigquerydatatransfer/readme",
"versions": [
"v0.3.0",
"v0.2.0",
"v0.1.0",
"master"
]
},
Expand Down

0 comments on commit be4ce7f

Please sign in to comment.