diff --git a/.gitignore b/.gitignore index aae4db8a3601..ff6640ed343f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,5 @@ build/ composer.phar composer.lock -docs/json/**/*.json +docs/json/* vendor/ diff --git a/dev/src/DocGenerator/Command/Docs.php b/dev/src/DocGenerator/Command/Docs.php index 2ade7f174d00..92be58916dd0 100644 --- a/dev/src/DocGenerator/Command/Docs.php +++ b/dev/src/DocGenerator/Command/Docs.php @@ -39,6 +39,7 @@ class Docs extends Command const DEFAULT_OUTPUT_DIR = 'docs/json'; const TOC_SOURCE_DIR = 'docs/contents'; const TOC_TEMPLATE = 'docs/toc.json'; + const OVERVIEW_FILE = 'docs/overview.html'; const DEFAULT_SOURCE_DIR = 'src'; private $cliBasePath; @@ -74,7 +75,8 @@ protected function execute(InputInterface $input, OutputInterface $output) 'project' => $this->cliBasePath .'/../', 'manifest' => $this->cliBasePath .'/../docs/manifest.json', 'toc' => $this->cliBasePath .'/../'. self::TOC_SOURCE_DIR, - 'tocTemplate' => $this->cliBasePath .'/../'. self::TOC_TEMPLATE + 'tocTemplate' => $this->cliBasePath .'/../'. self::TOC_TEMPLATE, + 'overview' => $this->cliBasePath .'/../'. self::OVERVIEW_FILE ]; $components = $this->getComponents($paths['source']); @@ -83,15 +85,33 @@ protected function execute(InputInterface $input, OutputInterface $output) foreach ($components as $component) { $input = $paths['project'] . $component['path']; $source = $this->getFilesList($input); - $this->generateComponentDocumentation($output, $source, $component, $paths, $tocTemplate, $release, $pretty); + $this->generateComponentDocumentation( + $output, + $source, + $component, + $paths, + $tocTemplate, + $release, + $pretty + ); } - $source = [$paths['project'] .'src/ServiceBuilder.php']; + $source = $this->getFilesList($paths['project'] . '/src'); $component = [ 'id' => 'google-cloud', 'path' => 'src/' ]; - $this->generateComponentDocumentation($output, $source, $component, $paths, $tocTemplate, $release, $pretty); + + $this->generateComponentDocumentation( + $output, + $source, + $component, + $paths, + $tocTemplate, + $release, + $pretty, + false + ); } private function generateComponentDocumentation( @@ -101,7 +121,8 @@ private function generateComponentDocumentation( array $paths, $tocTemplate, $release = false, - $pretty = false + $pretty = false, + $linkCrossComponent = true ) { $output->writeln(sprintf('Writing documentation for %s', $component['id'])); $output->writeln('--------------'); @@ -123,23 +144,29 @@ private function generateComponentDocumentation( $this->cliBasePath, $component['id'], $paths['manifest'], - $release + $release, + $linkCrossComponent ); + $docs->generate($component['path'], $pretty); $types->write($pretty); $output->writeln(sprintf('Writing table of contents to %s', realpath($outputPath))); - $services = json_decode(file_get_contents($paths['toc'] .'/'. $component['id'] .'.json'), true); + $contents = json_decode(file_get_contents($paths['toc'] .'/'. $component['id'] .'.json'), true); $toc = new TableOfContents( $tocTemplate, - $services, + $component['id'], $release, + $paths['toc'], $outputPath ); $toc->generate($pretty); + $output->writeln(sprintf('Copying overview.html to %s', realpath($outputPath))); + copy($paths['overview'], $outputPath .'/overview.html'); + $output->writeln(' '); $output->writeln(' '); } diff --git a/dev/src/DocGenerator/DocGenerator.php b/dev/src/DocGenerator/DocGenerator.php index 239e54eb1dca..28ccfea0c057 100644 --- a/dev/src/DocGenerator/DocGenerator.php +++ b/dev/src/DocGenerator/DocGenerator.php @@ -35,6 +35,7 @@ class DocGenerator private $componentId; private $manifestPath; private $release; + private $linkCrossComponent; /** * @param array $files @@ -46,7 +47,8 @@ public function __construct( $executionPath, $componentId, $manifestPath, - $release + $release, + $linkCrossComponent = true ) { $this->types = $types; $this->files = $files; @@ -55,6 +57,7 @@ public function __construct( $this->componentId = $componentId; $this->manifestPath = $manifestPath; $this->release = $release; + $this->linkCrossComponent = $linkCrossComponent; } /** @@ -84,7 +87,8 @@ public function generate($basePath, $pretty) dirname($this->executionPath), $this->componentId, $this->manifestPath, - $this->release + $this->release, + $this->linkCrossComponent ); } else { $content = file_get_contents($file); @@ -100,7 +104,9 @@ public function generate($basePath, $pretty) $this->types->addType([ 'id' => $document['id'], 'title' => $document['title'], - 'contents' => $this->prune($document['id'] . '.json') + 'contents' => ($this->linkCrossComponent) + ? $this->prune($document['id'] . '.json') + : $document['id'] . '.json' ]); } } diff --git a/dev/src/DocGenerator/Parser/CodeParser.php b/dev/src/DocGenerator/Parser/CodeParser.php index fd13c43f8885..bfb9865f4a8f 100644 --- a/dev/src/DocGenerator/Parser/CodeParser.php +++ b/dev/src/DocGenerator/Parser/CodeParser.php @@ -39,6 +39,7 @@ class CodeParser implements ParserInterface private $componentId; private $manifestPath; private $release; + private $linkCrossComponent; public function __construct( $path, @@ -47,7 +48,8 @@ public function __construct( $projectRoot, $componentId, $manifestPath, - $release + $release, + $linkCrossComponent = true ) { $this->path = $path; $this->outputName = $outputName; @@ -58,6 +60,7 @@ public function __construct( $this->componentId = $componentId; $this->manifestPath = $manifestPath; $this->release = $release; + $this->linkCrossComponent = $linkCrossComponent; } public function parse() @@ -504,7 +507,7 @@ private function buildExternalType($type) private function buildLink($content) { $componentId = null; - if (substr_compare(trim($content, '\\'), 'Google\Cloud', 0, 12) === 0) { + if ($this->linkCrossComponent && substr_compare(trim($content, '\\'), 'Google\Cloud', 0, 12) === 0) { try { $matches = []; preg_match('/[Generator\<]?(Google\\\Cloud\\\[\w\\\]{0,})[\>]?[\[\]]?/', $content, $matches); diff --git a/dev/src/DocGenerator/TableOfContents.php b/dev/src/DocGenerator/TableOfContents.php index 162a5877c8be..d5567e88364b 100644 --- a/dev/src/DocGenerator/TableOfContents.php +++ b/dev/src/DocGenerator/TableOfContents.php @@ -20,25 +20,61 @@ class TableOfContents { private $template; - private $component; + private $componentId; private $componentVersion; + private $contentsPath; private $outputPath; - public function __construct(array $template, array $component, $componentVersion, $outputPath) + public function __construct(array $template, $componentId, $componentVersion, $contentsPath, $outputPath) { $this->template = $template; - $this->component = $component; + $this->componentId = $componentId; $this->componentVersion = $componentVersion; + $this->contentsPath = $contentsPath; $this->outputPath = $outputPath; } public function generate($pretty = false) { - $toc = $this->template; - $toc['services'] = $this->component; - $toc['tagName'] = $this->componentVersion; + $toc = $this->getToc($this->componentId); - $writer = new Writer($toc, $this->outputPath, $pretty); + $tpl = $this->template; + $tpl['services'] = $this->services($toc); + $tpl['tagName'] = $this->componentVersion; + + $writer = new Writer($tpl, $this->outputPath, $pretty); $writer->write('toc.json'); } + + private function services(array $toc) + { + $services = $toc['services']; + + if (isset($toc['includes'])) { + foreach ($toc['includes'] as $include) { + $toc = $this->getToc($include); + $nested = $toc['services']; + $firstService = array_shift($nested); + + $service = [ + 'title' => $toc['title'], + 'type' => $firstService['type'], + 'nav' => $nested + ]; + + if (isset($toc['pattern'])) { + $service['patterns'] = [$toc['pattern']]; + } + + $services[] = $service; + } + } + + return $services; + } + + private function getToc($componentId) + { + return json_decode(file_get_contents($this->contentsPath .'/'. $componentId .'.json'), true); + } } diff --git a/docs/contents/cloud-bigquery.json b/docs/contents/cloud-bigquery.json index 1d92ef396619..5fb32b3044f9 100644 --- a/docs/contents/cloud-bigquery.json +++ b/docs/contents/cloud-bigquery.json @@ -1,31 +1,35 @@ -[{ - "title": "BigQueryClient", - "type": "bigquery/bigqueryclient" -}, { - "title": "Bytes", - "type": "bigquery/bytes" -}, { - "title": "Dataset", - "type": "bigquery/dataset" -}, { - "title": "Date", - "type": "bigquery/date" -}, { - "title": "InsertResponse", - "type": "bigquery/insertresponse" -}, { - "title": "Job", - "type": "bigquery/job" -}, { - "title": "QueryResults", - "type": "bigquery/queryresults" -}, { - "title": "Table", - "type": "bigquery/table" -}, { - "title": "Time", - "type": "bigquery/time" -}, { - "title": "Timestamp", - "type": "bigquery/timestamp" -}] +{ + "title": "BigQuery", + "pattern": "bigquery\/\\w{1,}", + "services": [{ + "title": "BigQueryClient", + "type": "bigquery/bigqueryclient" + }, { + "title": "Bytes", + "type": "bigquery/bytes" + }, { + "title": "Dataset", + "type": "bigquery/dataset" + }, { + "title": "Date", + "type": "bigquery/date" + }, { + "title": "InsertResponse", + "type": "bigquery/insertresponse" + }, { + "title": "Job", + "type": "bigquery/job" + }, { + "title": "QueryResults", + "type": "bigquery/queryresults" + }, { + "title": "Table", + "type": "bigquery/table" + }, { + "title": "Time", + "type": "bigquery/time" + }, { + "title": "Timestamp", + "type": "bigquery/timestamp" + }] +} diff --git a/docs/contents/cloud-core.json b/docs/contents/cloud-core.json index 9779bf4b5c63..3b0b80bc4949 100644 --- a/docs/contents/cloud-core.json +++ b/docs/contents/cloud-core.json @@ -1,30 +1,37 @@ -[{ - "title": "Overview", - "type": "core/readme" -}, { - "title": "IAM", - "type": "core/iam/iam", - "patterns": [ - "core/iam/\\w{1,}" - ], - "nav": [{ - "title": "PolicyBuilder", - "type": "core/iam/policybuilder" - }] -}, { - "title": "Upload", - "type": "core/upload/abstractuploader", - "nav": [{ - "title": "MultipartUploader", - "type": "core/upload/multipartuploader" +{ + "title": "Core", + "pattern": "core\/\\w{1,}", + "services": [{ + "title": "Overview", + "type": "core/readme" + }, { + "title": "IAM", + "type": "core/iam/iam", + "patterns": [ + "core/iam/\\w{1,}" + ], + "nav": [{ + "title": "PolicyBuilder", + "type": "core/iam/policybuilder" + }] }, { - "title": "ResumableUploader", - "type": "core/upload/resumableuploader" + "title": "Upload", + "type": "core/upload/abstractuploader", + "patterns": [ + "core/upload/\\w{1,}" + ], + "nav": [{ + "title": "MultipartUploader", + "type": "core/upload/multipartuploader" + }, { + "title": "ResumableUploader", + "type": "core/upload/resumableuploader" + }, { + "title": "StreamableUploader", + "type": "core/upload/streamableuploader" + }] }, { - "title": "StreamableUploader", - "type": "core/upload/streamableuploader" + "title": "Int64", + "type": "core/int64" }] -}, { - "title": "Int64", - "type": "core/int64" -}] +} diff --git a/docs/contents/cloud-datastore.json b/docs/contents/cloud-datastore.json index aec83962d0d2..e0281101729b 100644 --- a/docs/contents/cloud-datastore.json +++ b/docs/contents/cloud-datastore.json @@ -1,25 +1,29 @@ -[{ - "title": "DatastoreClient", - "type": "datastore/datastoreclient" -}, { - "title": "Transaction", - "type": "datastore/transaction" -}, { - "title": "Entity", - "type": "datastore/entity" -}, { - "title": "Key", - "type": "datastore/key" -}, { - "title": "Query", - "type": "datastore/query/query" -}, { - "title": "GQL Query", - "type": "datastore/query/gqlquery" -}, { - "title": "GeoPoint", - "type": "datastore/geopoint" -}, { - "title": "Blob", - "type": "datastore/blob" -}] +{ + "title": "Datastore", + "pattern": "datastore\/\\w{1,}", + "services": [{ + "title": "DatastoreClient", + "type": "datastore/datastoreclient" + }, { + "title": "Transaction", + "type": "datastore/transaction" + }, { + "title": "Entity", + "type": "datastore/entity" + }, { + "title": "Key", + "type": "datastore/key" + }, { + "title": "Query", + "type": "datastore/query/query" + }, { + "title": "GQL Query", + "type": "datastore/query/gqlquery" + }, { + "title": "GeoPoint", + "type": "datastore/geopoint" + }, { + "title": "Blob", + "type": "datastore/blob" + }] +} diff --git a/docs/contents/cloud-error-reporting.json b/docs/contents/cloud-error-reporting.json index a6f2d22170da..b1801f20f9fc 100644 --- a/docs/contents/cloud-error-reporting.json +++ b/docs/contents/cloud-error-reporting.json @@ -1,20 +1,24 @@ -[{ - "title": "Overview", - "type": "errorreporting/readme" -}, { - "title": "v1beta1", - "type": "errorreporting/v1beta1/readme", - "patterns": [ - "errorreporting/v1beta1/\\w{1,}" - ], - "nav": [{ - "title": "ErrorGroupServiceClient", - "type": "errorreporting/v1beta1/errorgroupserviceclient" +{ + "title": "Error Reporting", + "pattern": "errorreporting\/\\w{1,}", + "services": [{ + "title": "Overview", + "type": "errorreporting/readme" }, { - "title": "ErrorStatsServiceClient", - "type": "errorreporting/v1beta1/errorstatsserviceclient" - }, { - "title": "ReportErrorsServiceClient", - "type": "errorreporting/v1beta1/reporterrorsserviceclient" + "title": "v1beta1", + "type": "errorreporting/v1beta1/readme", + "patterns": [ + "errorreporting/v1beta1/\\w{1,}" + ], + "nav": [{ + "title": "ErrorGroupServiceClient", + "type": "errorreporting/v1beta1/errorgroupserviceclient" + }, { + "title": "ErrorStatsServiceClient", + "type": "errorreporting/v1beta1/errorstatsserviceclient" + }, { + "title": "ReportErrorsServiceClient", + "type": "errorreporting/v1beta1/reporterrorsserviceclient" + }] }] -}] +} diff --git a/docs/contents/cloud-logging.json b/docs/contents/cloud-logging.json index 8b40def8299f..a8b8d02422ac 100644 --- a/docs/contents/cloud-logging.json +++ b/docs/contents/cloud-logging.json @@ -1,35 +1,39 @@ -[{ - "title": "LoggingClient", - "type": "logging/loggingclient" -}, { - "title": "Entry", - "type": "logging/entry" -}, { - "title": "Logger", - "type": "logging/logger" -}, { - "title": "Metric", - "type": "logging/metric" -},{ - "title": "PsrLogger", - "type": "logging/psrlogger" -},{ - "title": "Sink", - "type": "logging/sink" -}, { - "title": "v2", - "type": "logging/v2/readme", - "patterns": [ - "logging/v2/\\w{1,}" - ], - "nav": [{ - "title": "ConfigServiceV2Client", - "type": "logging/v2/configservicev2client" +{ + "title": "Logging", + "pattern": "logging\/\\w{1,}", + "services": [{ + "title": "LoggingClient", + "type": "logging/loggingclient" }, { - "title": "LoggingServiceV2Client", - "type": "logging/v2/loggingservicev2client" + "title": "Entry", + "type": "logging/entry" }, { - "title": "MetricsServiceV2Client", - "type": "logging/v2/metricsservicev2client" + "title": "Logger", + "type": "logging/logger" + }, { + "title": "Metric", + "type": "logging/metric" + },{ + "title": "PsrLogger", + "type": "logging/psrlogger" + },{ + "title": "Sink", + "type": "logging/sink" + }, { + "title": "v2", + "type": "logging/v2/readme", + "patterns": [ + "logging/v2/\\w{1,}" + ], + "nav": [{ + "title": "ConfigServiceV2Client", + "type": "logging/v2/configservicev2client" + }, { + "title": "LoggingServiceV2Client", + "type": "logging/v2/loggingservicev2client" + }, { + "title": "MetricsServiceV2Client", + "type": "logging/v2/metricsservicev2client" + }] }] -}] +} diff --git a/docs/contents/cloud-monitoring.json b/docs/contents/cloud-monitoring.json index 092ed41613bc..d6ff59d0ded5 100644 --- a/docs/contents/cloud-monitoring.json +++ b/docs/contents/cloud-monitoring.json @@ -1,17 +1,21 @@ -[{ - "title": "Overview", - "type": "monitoring/readme" -}, { - "title": "v3", - "type": "monitoring/v3/readme", - "patterns": [ - "monitoring/v3/\\w{1,}" - ], - "nav": [{ - "title": "GroupServiceClient", - "type": "monitoring/v3/groupserviceclient" +{ + "title": "Monitoring", + "pattern": "monitoring\/\\w{1,}", + "services": [{ + "title": "Overview", + "type": "monitoring/readme" }, { - "title": "MetricServiceClient", - "type": "monitoring/v3/metricserviceclient" + "title": "v3", + "type": "monitoring/v3/readme", + "patterns": [ + "monitoring/v3/\\w{1,}" + ], + "nav": [{ + "title": "GroupServiceClient", + "type": "monitoring/v3/groupserviceclient" + }, { + "title": "MetricServiceClient", + "type": "monitoring/v3/metricserviceclient" + }] }] -}] +} diff --git a/docs/contents/cloud-natural-language.json b/docs/contents/cloud-natural-language.json index c9d82e7b35cd..6552ba78fcf3 100644 --- a/docs/contents/cloud-natural-language.json +++ b/docs/contents/cloud-natural-language.json @@ -1,7 +1,11 @@ -[{ - "title": "NaturalLanguageClient", - "type": "naturallanguage/naturallanguageclient" -}, { - "title": "Annotation", - "type": "naturallanguage/annotation" -}] +{ + "title": "Natural Language", + "pattern": "naturallanguage\/\\w{1,}", + "services": [{ + "title": "NaturalLanguageClient", + "type": "naturallanguage/naturallanguageclient" + }, { + "title": "Annotation", + "type": "naturallanguage/annotation" + }] +} diff --git a/docs/contents/cloud-pubsub.json b/docs/contents/cloud-pubsub.json index ef5acc571971..795fe56f064a 100644 --- a/docs/contents/cloud-pubsub.json +++ b/docs/contents/cloud-pubsub.json @@ -1,26 +1,30 @@ -[{ - "title": "PubSubClient", - "type": "pubsub/pubsubclient" -}, { - "title": "Message", - "type": "pubsub/message" -}, { - "title": "Subscription", - "type": "pubsub/subscription" -}, { - "title": "Topic", - "type": "pubsub/topic" -}, { - "title": "v1", - "type": "pubsub/v1/readme", - "patterns": [ - "pubsub/v1/\\w{1,}" - ], - "nav": [{ - "title": "PublisherClient", - "type": "pubsub/v1/publisherclient" +{ + "title": "Pub/Sub", + "pattern": "pubsub\/\\w{1,}", + "services": [{ + "title": "PubSubClient", + "type": "pubsub/pubsubclient" }, { - "title": "SubscriberClient", - "type": "pubsub/v1/subscriberclient" + "title": "Message", + "type": "pubsub/message" + }, { + "title": "Subscription", + "type": "pubsub/subscription" + }, { + "title": "Topic", + "type": "pubsub/topic" + }, { + "title": "v1", + "type": "pubsub/v1/readme", + "patterns": [ + "pubsub/v1/\\w{1,}" + ], + "nav": [{ + "title": "PublisherClient", + "type": "pubsub/v1/publisherclient" + }, { + "title": "SubscriberClient", + "type": "pubsub/v1/subscriberclient" + }] }] -}] +} diff --git a/docs/contents/cloud-speech.json b/docs/contents/cloud-speech.json index d433dce34a69..976f9acda989 100644 --- a/docs/contents/cloud-speech.json +++ b/docs/contents/cloud-speech.json @@ -1,17 +1,21 @@ -[{ - "title": "SpeechClient", - "type": "speech/speechclient" -}, { - "title": "Operation", - "type": "speech/operation" -}, { - "title": "v1beta1", - "type": "speech/v1beta1/readme", - "patterns": [ - "speech/v1beta1/\\w{1,}" - ], - "nav": [{ +{ + "title": "Speech", + "pattern": "speech\/\\w{1,}", + "services": [{ "title": "SpeechClient", - "type": "speech/v1beta1/speechclient" + "type": "speech/speechclient" + }, { + "title": "Operation", + "type": "speech/operation" + }, { + "title": "v1beta1", + "type": "speech/v1beta1/readme", + "patterns": [ + "speech/v1beta1/\\w{1,}" + ], + "nav": [{ + "title": "SpeechClient", + "type": "speech/v1beta1/speechclient" + }] }] -}] +} diff --git a/docs/contents/cloud-storage.json b/docs/contents/cloud-storage.json index 0b7c36cbfd68..2105294f8fab 100644 --- a/docs/contents/cloud-storage.json +++ b/docs/contents/cloud-storage.json @@ -1,13 +1,17 @@ -[{ - "title": "StorageClient", - "type": "storage/storageclient" -}, { - "title": "ACL", - "type": "storage/acl" -}, { - "title": "Bucket", - "type": "storage/bucket" -}, { - "title": "StorageObject", - "type": "storage/storageobject" -}] +{ + "title": "Storage", + "pattern": "storage\/\\w{1,}", + "services": [{ + "title": "StorageClient", + "type": "storage/storageclient" + }, { + "title": "ACL", + "type": "storage/acl" + }, { + "title": "Bucket", + "type": "storage/bucket" + }, { + "title": "StorageObject", + "type": "storage/storageobject" + }] +} diff --git a/docs/contents/cloud-translate.json b/docs/contents/cloud-translate.json index d829deaa0161..4ee6a8b7c3eb 100644 --- a/docs/contents/cloud-translate.json +++ b/docs/contents/cloud-translate.json @@ -1,4 +1,8 @@ -[{ - "title": "TranslateClient", - "type": "translate/translateclient" -}] +{ + "title": "Translation", + "pattern": "translate\/\\w{1,}", + "services": [{ + "title": "TranslateClient", + "type": "translate/translateclient" + }] +} diff --git a/docs/contents/cloud-vision.json b/docs/contents/cloud-vision.json index 1ffef7a6ec5f..356f4d804828 100644 --- a/docs/contents/cloud-vision.json +++ b/docs/contents/cloud-vision.json @@ -1,34 +1,38 @@ -[{ - "title": "VisionClient", - "type": "vision/visionclient" -}, { - "title": "Image", - "type": "vision/image" -}, { - "title": "Annotation", - "type": "vision/annotation", - "nav": [ - { - "title": "CropHint", - "type": "vision/annotation/crophint" - }, { - "title": "Document", - "type": "vision/annotation/document" - }, { - "title": "Entity", - "type": "vision/annotation/entity" - }, { - "title": "Face", - "type": "vision/annotation/face" - }, { - "title": "ImageProperties", - "type": "vision/annotation/imageproperties" - }, { - "title": "SafeSearch", - "type": "vision/annotation/safesearch" - }, { - "title": "Web", - "type": "vision/annotation/web" - } - ] -}] +{ + "title": "Vision", + "pattern": "vision\/\\w{1,}", + "services": [{ + "title": "VisionClient", + "type": "vision/visionclient" + }, { + "title": "Image", + "type": "vision/image" + }, { + "title": "Annotation", + "type": "vision/annotation", + "nav": [ + { + "title": "CropHint", + "type": "vision/annotation/crophint" + }, { + "title": "Document", + "type": "vision/annotation/document" + }, { + "title": "Entity", + "type": "vision/annotation/entity" + }, { + "title": "Face", + "type": "vision/annotation/face" + }, { + "title": "ImageProperties", + "type": "vision/annotation/imageproperties" + }, { + "title": "SafeSearch", + "type": "vision/annotation/safesearch" + }, { + "title": "Web", + "type": "vision/annotation/web" + } + ] + }] +} diff --git a/docs/contents/google-cloud.json b/docs/contents/google-cloud.json index ab88991df84b..0da62d46cb8d 100644 --- a/docs/contents/google-cloud.json +++ b/docs/contents/google-cloud.json @@ -1,4 +1,21 @@ -[{ - "title": "ServiceBuilder", - "type": "servicebuilder" -}] +{ + "title": "Google Cloud PHP", + "services": [{ + "title": "ServiceBuilder", + "type": "servicebuilder" + }], + "includes": [ + "cloud-bigquery", + "cloud-datastore", + "cloud-error-reporting", + "cloud-logging", + "cloud-monitoring", + "cloud-natural-language", + "cloud-pubsub", + "cloud-speech", + "cloud-storage", + "cloud-translate", + "cloud-vision", + "cloud-core" + ] +} diff --git a/docs/home.html b/docs/home.html deleted file mode 100644 index 82f9296f1687..000000000000 --- a/docs/home.html +++ /dev/null @@ -1,122 +0,0 @@ -<section class="hero-banner"> - <div class="container clearfix"> - <div class="quote-box"> - <h1>google/cloud</h1> - <p>Google Cloud Client Library for PHP - - an idiomatic, intuitive, and natural way for PHP developers to - integrate with Google Cloud Platform services, like Cloud Datastore - and Cloud Storage.</p> - </div> - - <div class="quote-box--supplementary"> - <pre class="skip-highlight"><code class="subtle--blue">$</code> composer require <strong>google/cloud</strong></pre> - <h4 class="latest-release subtle" ng-if="home.latestRelease"> - Latest Release <a ng-href="{{home.latestRelease.link}}" class="latest-release--link white">{{home.latestRelease.name}}</a> - {{home.latestRelease.date|date}} - </h4> - </div> - </div><!-- end of .container --> -</section><!-- end of .hero-banner --> - -<section class="block featuring"> - <div class="container"> - <ul class="featuring-links"> - <li> - <a href="#/docs/google-cloud/{{home.latestRelease.name}}/servicebuilder" title="google-cloud-php docs" class="btn btn-docs"> - <img src="src/images/icon-lang-php-gray.svg" alt="PHP icon" /> - Read the Docs - </a> - </li> - <li> - <a href="https://github.com/GoogleCloudPlatform/google-cloud-php" title="google-cloud-php on GitHub" class="ext-link"> - <img src="src/images/icon-link-github.svg" alt="GitHub icon" /> - GitHub - </a> - </li> - <li> - <a href="https://github.com/GoogleCloudPlatform/google-cloud-php/issues" title="google-cloud-php issues on Github" class="ext-link"> - <img src="src/images/icon-link-github.svg" alt="GitHub icon" /> - Issues - </a> - </li> - <li> - <a href="http://stackoverflow.com/questions/tagged/google-cloud-platform+php" title="google-cloud-php on StackOverflow" class="ext-link"> - <img src="src/images/icon-link-stackoverflow.svg" alt="StackOverflow icon" /> - StackOverflow - </a> - </li> - <li> - <a href="https://packagist.org/packages/google/cloud" title="google-cloud-php on Packagist" class="ext-link"> - <img src="src/images/icon-link-package-manager.svg" alt="Packagist icon" /> - Packagist - </a> - </li> - </ul> - </div><!-- end of .container --> -</section><!-- end of .featuring --> - -<section class="block about"> - <div class="container clearfix"> - <div class="quote-box"> - <h3 class="block-title">What is it?</h3> - - <p>The <code>Google Cloud Client Library</code> is a client - library for accessing Google Cloud Platform services that significantly - reduces the boilerplate code you have to write. The library provides - high-level API abstractions so they're easier to understand. It embraces - idioms of PHP, works well with the standard library, and - integrates better with your codebase. - All this means you spend more time creating code that matters - to you.</p> - - <p>The <code>Google Cloud Client Library</code> is configured to - access Google Cloud Platform services and authenticate (OAuth 2.0) - automatically on your behalf. With a one-line install and a private key, - you are up and ready to go. Better yet, if you are running on a Google - Compute Engine instance, the one-line install is enough!</p> - </div> - - <div class="quote-box--supplementary"> - <h4>Example: Retrieve a bucket from Cloud Storage</h4> - <div hljs hljs-language="php5" no-escape> -use Google\Cloud\ServiceBuilder; - -$gcloud = new ServiceBuilder([ - 'keyFilePath' => '/path/to/key/file.json', - 'projectId' => 'myProject' -]); - -$storage = $gcloud->storage(); - -$bucket = $storage->bucket('myBucket');</div> - </div> - </div><!-- end of .container --> -</section><!-- end of .featuring --> - - <section class="block"> - <div class="container clearfix"> - <h3 class="block-title">FAQ</h3> - - <h4>What is the relationship between the <code>Google Cloud Client Library</code> package - and the <code>gcloud</code> command-line tool?</h4> - <p>Both the <code>gcloud</code> command-line tool and the - <code>Google Cloud Client Library</code> package are a part of the Google - Cloud SDK: a collection of tools and libraries that enable you to easily - create and manage resources on the Google Cloud Platform. - The <code>gcloud</code> command-line tool can be used to manage both your - development workflow and your Google Cloud Platform resources while the - <code>Google Cloud Client Library</code> package is the offical library - for interacting with PHP.</p> - - <h4>What is the relationship between the <code>Google Cloud Client Library</code> - and the Google APIs PHP Client?</h4> - <p>The <a href="https://github.com/google/google-api-php-client"> - Google APIs PHP Client</a> is a client library for - using the broad set of Google APIs. - The <code>Google Cloud Client Library</code> is built specifically for the - Google Cloud Platform and is the recommended way to integrate Google Cloud - APIs into your PHP applications. If your application requires both Google - Cloud Platform and other Google APIs, the 2 libraries may be used by your - application.</p> - </div> -</section> <!-- end of FAQ -->