3.7 KiB
3.7 KiB
| mode | applyTo |
|---|---|
| edit | content/{influxdb3/core,influxdb3/enterprise,shared/influxdb3*}/** |
Best Practices
- Use UPPERCASE for placeholders to make them easily identifiable
- Don't use pronouns in placeholders (e.g., "your", "this")
- List placeholders in the same order they appear in the code
- Provide clear descriptions including:
-
- Expected data type or format
-
- Purpose of the value
-
- Any constraints or requirements
- Mark optional placeholders as "Optional:" in their descriptions
- Placeholder key descriptions should fit the context of the code snippet
- Include examples for complex formats
Writing Placeholder Descriptions
Descriptions should follow consistent patterns:
- Admin Authentication tokens:
- Recommended: "a {{% token-link "admin" %}} for your {{< product-name >}} instance"
- Avoid: "your token", "the token", "an authorization token"
- Database resource tokens:
- Recommended: "your {{% token-link "database" %}}"{{% show-in "enterprise" %}} with permissions on the specified database{{% /show-in %}}
- Avoid: "your token", "the token", "an authorization token"
- Database names:
- Recommended: "the name of the database to [action]"
- Avoid: "your database", "the database name"
- Conditional content:
- Use
{{% show-in "enterprise" %}}for content specific to enterprise versions - Example: "your {{% token-link "database" %}}{{% show-in "enterprise" %}} with permission to query the specified database{{% /show-in %}}"
- Use
Common placeholders for InfluxDB 3
AUTH_TOKEN: your {{% token-link %}}DATABASE_NAME: the database to useTABLE_NAME: Name of the table/measurement to query or write toNODE_ID: Node ID for a specific node in a clusterCLUSTER_ID: Cluster ID for a specific clusterHOST: InfluxDB server hostname or URLPORT: InfluxDB server port (typically 8181)QUERY: SQL or InfluxQL query stringLINE_PROTOCOL: Line protocol data for writesPLUGIN_FILENAME: Name of plugin file to useCACHE_NAME: Name for a new or existing cache
Hugo shortcodes in Markdown
Syntax:
- Use the
placeholderscode block attribute to define placeholder patterns:function sampleCode () {};
Old (deprecated) syntax:
{{% code-placeholders "PLACEHOLDER1|PLACEHOLDER2" %}}{{% /code-placeholders %}}
Define a placeholder key (typically following the example):
{{% code-placeholder-key %}}: Use this shortcode to define a placeholder key{{% /code-placeholder-key %}}: Use this shortcode to close the key name- Follow with a description
Language-Specific Placeholder Formatting
- Bash/Shell: Use uppercase variables with no quotes or prefix
--database DATABASE_NAME - Python: Use string literals with quotes
database_name='DATABASE_NAME' - JSON: Use key-value pairs with quotes
{ "database": "DATABASE_NAME" }
Real-World Examples from Documentation
InfluxDB CLI Commands
This pattern appears frequently in CLI documentation:
influxdb3 write \
--database DATABASE_NAME \
--token AUTH_TOKEN \
--precision ns
{{% /code-placeholders %}}
Replace the following placeholders with your values:
{{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: the name of the database to write to
{{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: your {{% token-link "database" %}}{{% show-in "enterprise" %}} with write permissions on the specified database{{% /show-in %}}