Skip to content

Commit

Permalink
Fix docs for restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
dwsupplee committed Mar 28, 2018
1 parent 0b1bbb3 commit bbb30e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 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);
}
}
2 changes: 1 addition & 1 deletion 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.57.1",
"v0.57.0",
Expand Down

0 comments on commit bbb30e9

Please sign in to comment.