diff --git a/dev/src/DocGenerator/DocGenerator.php b/dev/src/DocGenerator/DocGenerator.php index 70fa16f5f0fc..f9228cb1d08e 100644 --- a/dev/src/DocGenerator/DocGenerator.php +++ b/dev/src/DocGenerator/DocGenerator.php @@ -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); - } } diff --git a/docs/manifest.json b/docs/manifest.json index 9cb98b5035c6..587c4e130fad 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -9,7 +9,7 @@ { "id": "google-cloud", "name": "google/cloud", - "defaultService": "readme", + "defaultService": "servicebuilder", "versions": [ "v0.58.0", "v0.57.1", @@ -119,8 +119,6 @@ "defaultService": "bigquerydatatransfer/readme", "versions": [ "v0.3.0", - "v0.2.0", - "v0.1.0", "master" ] },