Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

Commit 57bb180

Browse files
authored
chore(cloud-rad): add code fencing for TSDoc (#1689)
Instead of `<caption>` use rich text for examples. See #1679
1 parent 92e050c commit 57bb180

3 files changed

Lines changed: 47 additions & 16 deletions

File tree

src/bucket.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2129,18 +2129,24 @@ class Bucket extends ServiceObject {
21292129
* });
21302130
*
21312131
* ```
2132-
* @example <caption>Optionally, provide a destination bucket.</caption>
2132+
* @example
2133+
* Optionally, provide a destination bucket.
2134+
* ```
21332135
* const config = {
21342136
* prefix: 'log',
21352137
* bucket: 'destination-bucket'
21362138
* };
21372139
*
21382140
* bucket.enableLogging(config, function(err, apiResponse) {});
2141+
* ```
21392142
*
2140-
* @example <caption>If the callback is omitted, we'll return a Promise.</caption>
2143+
* @example
2144+
* If the callback is omitted, we'll return a Promise.
2145+
* ```
21412146
* bucket.enableLogging(config).then(function(data) {
21422147
* const apiResponse = data[0];
21432148
* });
2149+
* ```
21442150
*/
21452151
enableLogging(
21462152
config: EnableLoggingOptions,
@@ -2440,7 +2446,9 @@ class Bucket extends ServiceObject {
24402446
* });
24412447
*
24422448
* ```
2443-
* @example <caption><h6>Simulating a File System</h6><p>With `autoPaginate: false`, it's possible to iterate over files which incorporate a common structure using a delimiter.</p><p>Consider the following remote objects:</p><ol><li>"a"</li><li>"a/b/c/d"</li><li>"b/d/e"</li></ol><p>Using a delimiter of `/` will return a single file, "a".</p><p>`apiResponse.prefixes` will return the "sub-directories" that were found:</p><ol><li>"a/"</li><li>"b/"</li></ol></caption>
2449+
* @example
2450+
* <h6>Simulating a File System</h6><p>With `autoPaginate: false`, it's possible to iterate over files which incorporate a common structure using a delimiter.</p><p>Consider the following remote objects:</p><ol><li>"a"</li><li>"a/b/c/d"</li><li>"b/d/e"</li></ol><p>Using a delimiter of `/` will return a single file, "a".</p><p>`apiResponse.prefixes` will return the "sub-directories" that were found:</p><ol><li>"a/"</li><li>"b/"</li></ol>
2451+
* ```
24442452
* bucket.getFiles({
24452453
* autoPaginate: false,
24462454
* delimiter: '/'
@@ -2454,8 +2462,11 @@ class Bucket extends ServiceObject {
24542462
* // 'b/'
24552463
* // ]
24562464
* });
2465+
* ```
24572466
*
2458-
* @example <caption>Using prefixes, it's now possible to simulate a file system with follow-up requests.</caption>
2467+
* @example
2468+
* Using prefixes, it's now possible to simulate a file system with follow-up requests.
2469+
* ```
24592470
* bucket.getFiles({
24602471
* autoPaginate: false,
24612472
* delimiter: '/',
@@ -2470,6 +2481,7 @@ class Bucket extends ServiceObject {
24702481
* // 'a/b/'
24712482
* // ]
24722483
* });
2484+
* ```
24732485
*
24742486
* @example <caption>include:samples/files.js</caption>
24752487
* region_tag:storage_list_files

src/index.ts

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,35 @@
2222
* @module {Storage} @google-cloud/storage
2323
* @alias nodejs-storage
2424
*
25-
* @example <caption>Install the client library with <a
26-
* href="https://www.npmjs.com/">npm</a>:</caption> npm install --save
27-
* @google-cloud/storage
25+
* @example
26+
* Install the client library with <a href="https://www.npmjs.com/">npm</a>:
27+
* ```
28+
* npm install --save @google-cloud/storage
29+
* ```
2830
*
29-
* @example <caption>Import the client library</caption>
31+
* @example
32+
* Import the client library
33+
* ```
3034
* const {Storage} = require('@google-cloud/storage');
35+
* ```
3136
*
32-
* @example <caption>Create a client that uses <a
37+
* @example
38+
* Create a client that uses <a
3339
* href="https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application">Application
34-
* Default Credentials (ADC)</a>:</caption> const storage = new Storage();
40+
* Default Credentials (ADC)</a>:
41+
* ```
42+
* const storage = new Storage();
43+
* ```
3544
*
36-
* @example <caption>Create a client with <a
45+
* @example
46+
* Create a client with <a
3747
* href="https://cloud.google.com/docs/authentication/production#obtaining_and_providing_service_account_credentials_manually">explicit
38-
* credentials</a>:</caption> const storage = new Storage({ projectId:
48+
* credentials</a>:
49+
* ```
50+
* const storage = new Storage({ projectId:
3951
* 'your-project-id', keyFilename: '/path/to/keyfile.json'
4052
* });
53+
* ```
4154
*
4255
* @example <caption>include:samples/quickstart.js</caption>
4356
* region_tag:storage_quickstart

src/storage.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -528,17 +528,23 @@ export class Storage extends Service {
528528
/**
529529
* Constructs the Storage client.
530530
*
531-
* @example <caption>Create a client that uses Application Default Credentials
532-
* (ADC)</caption>
531+
* @example
532+
* Create a client that uses Application Default Credentials
533+
* (ADC)
534+
* ```
533535
* const {Storage} = require('@google-cloud/storage');
534536
* const storage = new Storage();
537+
* ```
535538
*
536-
* @example <caption>Create a client with explicit credentials</caption>
539+
* @example
540+
* Create a client with explicit credentials
541+
* ```
537542
* const storage = new Storage({
538543
* projectId: 'your-project-id',
539544
* keyFilename: '/path/to/keyfile.json'
540545
* });
541-
*
546+
* ```
547+
542548
* @param {StorageOptions} [options] Configuration options.
543549
*/
544550
constructor(options: StorageOptions = {}) {

0 commit comments

Comments
 (0)