You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(docs): Redesign docs CLI tools for creating and editing content, add content/create.md tutorial page for the How to creat… (#6506)
* chore(docs): Add content/create.md tutorial page for the How to create your own documentation tutorial
chore(scripts): docs:create and docs:edit scripts for content creation and editing
Major improvements to docs:create UX for both Claude Code and external tool integration:
**New `docs` CLI command:**
- Add scripts/docs-cli.js - main CLI with subcommand routing
- Add bin field to package.json for `docs` command
- Usage: `docs create` and `docs edit` (cleaner than yarn commands)
**Smart piping detection:**
- Auto-detect when stdout is piped (\!process.stdout.isTTY)
- When piping: automatically output prompt text (no flag needed)
- When interactive: output prompt file path
- --print-prompt flag now optional (auto-enabled when piping)
**Specify products:**
- simplify link following behavior - treat relative paths as local files, all HTTP/HTTPS as external
- stdin now requires --products flag with product keys
- --products now accepts keys from products.yml (influxdb3_core, telegraf, etc.)
Examples:
--products influxdb3_core
--products influxdb3_core,influxdb3_enterprise
--products telegraf
**Usage examples:**
# Inside Claude Code - automatic execution
docs create drafts/new-feature.md
# Pipe to external AI - prompt auto-detected
docs create FILE --products X | claude -p
docs create FILE --products X | copilot -p
# Pipe from stdin
echo 'content' | docs create --products X | claude -p
Benefits:
- Cleaner syntax (no yarn --silent needed)
- No manual --print-prompt flag when piping
- Consistent with industry tools (git, npm, etc.)
- Backward compatible with yarn commands
WIP: docs:create usage examples
- Redesign of the docs CLI tools for creating and editing content
- Cleaner interface works better for piping output to agents and downstream utilities
- Updates README.md and other authoring docs
This repository includes a `docs` CLI tool for common documentation workflows:
```sh
npx docs create drafts/new-feature.md --products influxdb3_core
npx docs edit https://docs.influxdata.com/influxdb3/core/admin/
npx docs placeholders content/influxdb3/core/admin/upgrade.md
npx docs --help
```
**Run test cases:**
```sh
npx docs test
```
* Update content/create.md
* Update content/create.md
* Update content/create.md
* Update content/create.md
* Update scripts/templates/chatgpt-prompt.md
* Update DOCS-SHORTCODES.md
Copy file name to clipboardExpand all lines: DOCS-SHORTCODES.md
+90-28Lines changed: 90 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Complete reference for custom Hugo shortcodes used in InfluxData documentation.
19
19
-[Content Management](#content-management)
20
20
-[Special Purpose](#special-purpose)
21
21
22
-
---
22
+
***
23
23
24
24
## Notes and Warnings
25
25
@@ -146,7 +146,7 @@ Use the `{{< api-endpoint >}}` shortcode to generate a code block that contains
146
146
-**method**: HTTP request method (get, post, patch, put, or delete)
147
147
-**endpoint**: API endpoint
148
148
-**api-ref**: Link the endpoint to a specific place in the API documentation
149
-
-**influxdb_host**: Specify which InfluxDB product host to use _if the `endpoint` contains the `influxdb/host`shortcode_. Uses the current InfluxDB product as default. Supports the following product values:
149
+
-**influxdb_host**: Specify which InfluxDB product host to use *if the `endpoint` contains the `influxdb/host`shortcode*. Uses the current InfluxDB product as default. Supports the following product values:
150
150
- oss
151
151
- cloud
152
152
- serverless
@@ -268,11 +268,11 @@ To link to tabbed content, click on the tab and use the URL parameter shown. It
268
268
269
269
Use the `{{< page-nav >}}` shortcode to add page navigation buttons to a page. These are useful for guiding users through a set of docs that should be read in sequential order. The shortcode has the following parameters:
270
270
271
-
-**prev:** path of the previous document _(optional)_
272
-
-**next:** path of the next document _(optional)_
273
-
-**prevText:** override the button text linking to the previous document _(optional)_
274
-
-**nextText:** override the button text linking to the next document _(optional)_
275
-
-**keepTab:** include the currently selected tab in the button link _(optional)_
271
+
-**prev:** path of the previous document *(optional)*
272
+
-**next:** path of the next document *(optional)*
273
+
-**prevText:** override the button text linking to the previous document *(optional)*
274
+
-**nextText:** override the button text linking to the next document *(optional)*
275
+
-**keepTab:** include the currently selected tab in the button link *(optional)*
276
276
277
277
The shortcode generates buttons that link to both the previous and next documents. By default, the shortcode uses either the `list_title` or the `title` of the linked document, but you can use `prevText` and `nextText` to override button text.
278
278
@@ -308,7 +308,7 @@ The children shortcode can also be used to list only "section" articles (those w
308
308
{{< children show="pages" >}}
309
309
```
310
310
311
-
_By default, it displays both sections and pages._
311
+
*By default, it displays both sections and pages.*
312
312
313
313
Use the `type` argument to specify the format of the children list.
314
314
@@ -325,15 +325,15 @@ The following list types are available:
325
325
326
326
#### Include a "Read more" link
327
327
328
-
To include a "Read more" link with each child summary, set `readmore=true`. _Only the `articles` list type supports "Read more" links._
328
+
To include a "Read more" link with each child summary, set `readmore=true`. *Only the `articles` list type supports "Read more" links.*
329
329
330
330
```md
331
331
{{< children readmore=true >}}
332
332
```
333
333
334
334
#### Include a horizontal rule
335
335
336
-
To include a horizontal rule after each child summary, set `hr=true`. _Only the `articles` list type supports horizontal rules._
336
+
To include a horizontal rule after each child summary, set `hr=true`. *Only the `articles` list type supports horizontal rules.*
337
337
338
338
```md
339
339
{{< children hr=true >}}
@@ -390,11 +390,11 @@ This is useful for maintaining and referencing sample code variants in their nat
390
390
391
391
#### Include specific files from the same directory
392
392
393
-
> [!Caution]
393
+
> \[!Caution]
394
394
> **Don't use for code examples**
395
395
> Using this and `get-shared-text` shortcodes to include code examples prevents the code from being tested.
396
396
397
-
To include the text from one file in another file in the same directory, use the `{{< get-leaf-text >}}` shortcode. The directory that contains both files must be a Hugo [_Leaf Bundle_](https://gohugo.io/content-management/page-bundles/#leaf-bundles), a directory that doesn't have any child directories.
397
+
To include the text from one file in another file in the same directory, use the `{{< get-leaf-text >}}` shortcode. The directory that contains both files must be a Hugo [*Leaf Bundle*](https://gohugo.io/content-management/page-bundles/#leaf-bundles), a directory that doesn't have any child directories.
398
398
399
399
In the following example, `api` is a leaf bundle. `content` isn't.
400
400
@@ -447,13 +447,13 @@ Each children list `type` uses frontmatter properties when generating the list o
Use the `{{% token-link "<descriptor>" "<link_append>%}}` shortcode to automatically generate links to token management documentation. The shortcode accepts two _optional_ arguments:
724
+
Use the `{{% token-link "<descriptor>" "<link_append>%}}` shortcode to automatically generate links to token management documentation. The shortcode accepts two *optional* arguments:
725
725
726
726
- **descriptor**: An optional token descriptor
727
-
- **link_append**: An optional path to append to the token management link path, `/<product>/<version>/admin/tokens/`.
727
+
- **link\_append**: An optional path to append to the token management link path, `/<product>/<version>/admin/tokens/`.
728
728
729
729
```md
730
730
{{% token-link "database" "resource/" %}}
@@ -775,7 +775,7 @@ Descriptions should follow consistent patterns:
775
775
- Recommended: "your {{% token-link "database" %}}"{{% show-in "enterprise" %}} with permissions on the specified database{{% /show-in %}}
776
776
- Avoid: "your token", "the token", "an authorization token"
777
777
3. **Database names**:
778
-
- Recommended: "the name of the database to [action]"
778
+
- Recommended: "the name of the database to \[action]"
779
779
- Avoid: "your database", "the database name"
780
780
4. **Conditional content**:
781
781
- Use `{{% show-in "enterprise" %}}` for content specific to enterprise versions
@@ -797,13 +797,75 @@ Descriptions should follow consistent patterns:
797
797
798
798
#### Syntax
799
799
800
-
- `{ placeholders="PATTERN1|PATTERN2" }`: Use this code block attribute to define placeholder patterns
800
+
- `{ placeholders="PATTERN1|PATTERN2" }`: Use this code block attribute to define placeholder patterns
801
801
- `{{% code-placeholder-key %}}`: Use this shortcode to define a placeholder key
802
802
- `{{% /code-placeholder-key %}}`: Use this shortcode to close the key name
803
803
804
-
_The `placeholders` attribute supercedes the deprecated `code-placeholders` shortcode._
804
+
*The `placeholders` attribute supercedes the deprecated `code-placeholders` shortcode.*
805
+
806
+
#### Automated placeholder syntax
807
+
808
+
Use the `docs placeholders` command to automatically add placeholder syntax to code blocks and descriptions:
curl --request POST http://localhost:8086/write?db=DATABASE_NAME \
@@ -839,7 +901,7 @@ Sample dataset to output. Use either `set` argument name or provide the set as t
839
901
840
902
#### includeNull
841
903
842
-
Specify whether or not to include _null_ values in the dataset. Use either `includeNull` argument name or provide the boolean value as the second argument.
904
+
Specify whether or not to include *null* values in the dataset. Use either `includeNull` argument name or provide the boolean value as the second argument.
843
905
844
906
#### includeRange
845
907
@@ -1115,6 +1177,6 @@ The InfluxDB host placeholder that gets replaced by custom domains differs betwe
1115
1177
{{< influxdb/host "serverless" >}}
1116
1178
```
1117
1179
1118
-
---
1180
+
***
1119
1181
1120
1182
**For working examples**: Test all shortcodes in [content/example.md](content/example.md)
This repository contains the InfluxDB 2.x documentation published at [docs.influxdata.com](https://docs.influxdata.com).
7
+
This repository contains the InfluxData product documentation for InfluxDB and related tooling published at [docs.influxdata.com](https://docs.influxdata.com).
8
8
9
9
## Contributing
10
10
@@ -15,6 +15,26 @@ For information about contributing to the InfluxData documentation, see [Contrib
15
15
16
16
For information about testing the documentation, including code block testing, link validation, and style linting, see [Testing guide](DOCS-TESTING.md).
17
17
18
+
## Documentation Tools
19
+
20
+
This repository includes a `docs` CLI tool for common documentation workflows:
The InfluxData documentation uses [Hugo](https://gohugo.io/), a static site generator built in Go. The site uses Hugo's asset pipeline, which requires the extended version of Hugo along with NodeJS tools like PostCSS, to build and process stylesheets and JavaScript.
47
70
48
-
The InfluxData documentation uses [Hugo](https://gohugo.io/), a static site generator built in Go. The site uses Hugo's asset pipeline, which requires the extended version of Hugo along with NodeJS tools like PostCSS, to build and process stylesheets and JavaScript.
71
+
To install the required dependencies and build the assets, do the following:
49
72
50
-
To install the required dependencies and build the assets, do the following:
0 commit comments