Skip to content

Commit 51e75e2

Browse files
committed
Merge branch 'master' into explorer-ga
2 parents 0f0bb86 + ba1e7f8 commit 51e75e2

File tree

12 files changed

+245
-26
lines changed

12 files changed

+245
-26
lines changed

.github/copilot-instructions.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
# GitHub Copilot Instructions for InfluxData Documentation
1+
# Instructions for InfluxData Documentation
22

33
## Purpose and scope
44

5-
GitHub Copilot should help document InfluxData products by creating clear, accurate technical content with proper code examples, frontmatter, and formatting.
5+
Help document InfluxData products by creating clear, accurate technical content with proper code examples, frontmatter, and formatting.
66

77
## Documentation structure
88

99
- **Product version data**: `/data/products.yml`
10-
- **Products**:
10+
- **InfluxData products**:
11+
- InfluxDB 3 Explorer
12+
- Documentation source path: `/content/influxdb3/explorer`
13+
- Published for the web: https://docs.influxdata.com/influxdb3/explorer/
1114
- InfluxDB 3 Core
1215
- Documentation source path: `/content/influxdb3/core`
1316
- Published for the web: https://docs.influxdata.com/influxdb3/core/
@@ -92,7 +95,8 @@ GitHub Copilot should help document InfluxData products by creating clear, accur
9295

9396
## Markdown and shortcodes
9497

95-
- Include proper frontmatter for each page:
98+
- Include proper frontmatter for Markdown pages in `content/**/*.md` (except for
99+
shared content files in `content/shared/`):
96100

97101
```yaml
98102
title: # Page title (h1)
@@ -180,3 +184,17 @@ Table: keys: [_start, _stop, _field, _measurement]
180184
## Related repositories
181185

182186
- **Internal documentation assistance requests**: https://github.com/influxdata/DAR/issues Documentation
187+
188+
## Additional instruction files
189+
190+
For specific workflows and content types, also refer to:
191+
192+
- **InfluxDB 3 code placeholders**: `.github/instructions/influxdb3-code-placeholders.instructions.md` - Guidelines for placeholder formatting, descriptions, and shortcode usage in InfluxDB 3 documentation
193+
- **Contributing guidelines**: `.github/instructions/contributing.instructions.md` - Detailed style guidelines, shortcode usage, frontmatter requirements, and development workflows
194+
- **Content-specific instructions**: Check `.github/instructions/` directory for specialized guidelines covering specific documentation patterns and requirements
195+
196+
## Integration with specialized instructions
197+
198+
When working on InfluxDB 3 documentation (Core/Enterprise), prioritize the placeholder guidelines from `influxdb3-code-placeholders.instructions.md`.
199+
200+
For general documentation structure, shortcodes, and development workflows, follow the comprehensive guidelines in `contributing.instructions.md`.

CLAUDE.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Instructions for InfluxData Documentation
2+
3+
## Purpose and scope
4+
5+
Claude should help document InfluxData products by creating clear, accurate technical content with proper code examples, frontmatter, and formatting.
6+
7+
## Project overview
8+
9+
See @README.md
10+
11+
## Available NPM commands
12+
13+
@package.json
14+
15+
## Instructions for contributing
16+
17+
See @.github/copilot-instructions.md for style guidelines and
18+
product-specific documentation paths and URLs managed in this project.
19+
20+
See @.github/instructions/contributing.instructions.md for contributing
21+
information including using shortcodes and running tests.
22+
23+
See @.github/instructions/influxdb3-code-placeholders.instructions.md for using
24+
placeholders in code samples and CLI commands.
25+

assets/js/code-controls.js

Lines changed: 153 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import $ from 'jquery';
2+
import { context } from './page-context.js';
23

34
function initialize() {
45
var codeBlockSelector = '.article--content pre';
@@ -68,9 +69,94 @@ function initialize() {
6869
// Trigger copy failure state lifecycle
6970

7071
$('.copy-code').click(function () {
71-
let text = $(this)
72+
let codeElement = $(this)
7273
.closest('.code-controls')
73-
.prevAll('pre:has(code)')[0].innerText;
74+
.prevAll('pre:has(code)')[0];
75+
76+
let text = codeElement.innerText;
77+
78+
// Extract additional code block information
79+
const codeBlockInfo = extractCodeBlockInfo(codeElement);
80+
81+
// Add Google Analytics event tracking
82+
const currentUrl = new URL(window.location.href);
83+
84+
// Determine which tracking parameter to add based on product context
85+
switch (context) {
86+
case 'cloud':
87+
currentUrl.searchParams.set('dl', 'cloud');
88+
break;
89+
case 'core':
90+
/** Track using the same value used by www.influxdata.com pages */
91+
currentUrl.searchParams.set('dl', 'oss3');
92+
break;
93+
case 'enterprise':
94+
/** Track using the same value used by www.influxdata.com pages */
95+
currentUrl.searchParams.set('dl', 'enterprise');
96+
break;
97+
case 'serverless':
98+
currentUrl.searchParams.set('dl', 'serverless');
99+
break;
100+
case 'dedicated':
101+
currentUrl.searchParams.set('dl', 'dedicated');
102+
break;
103+
case 'clustered':
104+
currentUrl.searchParams.set('dl', 'clustered');
105+
break;
106+
case 'oss/enterprise':
107+
currentUrl.searchParams.set('dl', 'oss');
108+
break;
109+
case 'other':
110+
default:
111+
// No tracking parameter for other/unknown products
112+
break;
113+
}
114+
115+
// Add code block specific tracking parameters
116+
if (codeBlockInfo.language) {
117+
currentUrl.searchParams.set('code_lang', codeBlockInfo.language);
118+
}
119+
if (codeBlockInfo.lineCount) {
120+
currentUrl.searchParams.set('code_lines', codeBlockInfo.lineCount);
121+
}
122+
if (codeBlockInfo.hasPlaceholders) {
123+
currentUrl.searchParams.set('has_placeholders', 'true');
124+
}
125+
if (codeBlockInfo.blockType) {
126+
currentUrl.searchParams.set('code_type', codeBlockInfo.blockType);
127+
}
128+
if (codeBlockInfo.sectionTitle) {
129+
currentUrl.searchParams.set(
130+
'section',
131+
encodeURIComponent(codeBlockInfo.sectionTitle)
132+
);
133+
}
134+
if (codeBlockInfo.firstLine) {
135+
currentUrl.searchParams.set(
136+
'first_line',
137+
encodeURIComponent(codeBlockInfo.firstLine.substring(0, 100))
138+
);
139+
}
140+
141+
// Update browser history without triggering page reload
142+
if (window.history && window.history.replaceState) {
143+
window.history.replaceState(null, '', currentUrl.toString());
144+
}
145+
146+
// Send custom Google Analytics event if gtag is available
147+
if (typeof window.gtag !== 'undefined') {
148+
window.gtag('event', 'code_copy', {
149+
language: codeBlockInfo.language,
150+
line_count: codeBlockInfo.lineCount,
151+
has_placeholders: codeBlockInfo.hasPlaceholders,
152+
dl: codeBlockInfo.dl || null,
153+
section_title: codeBlockInfo.sectionTitle,
154+
first_line: codeBlockInfo.firstLine
155+
? codeBlockInfo.firstLine.substring(0, 100)
156+
: null,
157+
product: context,
158+
});
159+
}
74160

75161
const copyContent = async () => {
76162
try {
@@ -84,6 +170,71 @@ function initialize() {
84170
copyContent();
85171
});
86172

173+
/**
174+
* Extract contextual information about a code block
175+
* @param {HTMLElement} codeElement - The code block element
176+
* @returns {Object} Information about the code block
177+
*/
178+
function extractCodeBlockInfo(codeElement) {
179+
const codeTag = codeElement.querySelector('code');
180+
const info = {
181+
language: null,
182+
lineCount: 0,
183+
hasPlaceholders: false,
184+
blockType: 'code',
185+
dl: null, // Download script type
186+
sectionTitle: null,
187+
firstLine: null,
188+
};
189+
190+
// Extract language from class attribute
191+
if (codeTag && codeTag.className) {
192+
const langMatch = codeTag.className.match(
193+
/language-(\w+)|hljs-(\w+)|(\w+)/
194+
);
195+
if (langMatch) {
196+
info.language = langMatch[1] || langMatch[2] || langMatch[3];
197+
}
198+
}
199+
200+
// Count lines
201+
const text = codeElement.innerText || '';
202+
const lines = text.split('\n');
203+
info.lineCount = lines.length;
204+
205+
// Get first non-empty line
206+
info.firstLine = lines.find((line) => line.trim() !== '') || null;
207+
208+
// Check for placeholders (common patterns)
209+
info.hasPlaceholders =
210+
/\b[A-Z_]{2,}\b|\{\{[^}]+\}\}|\$\{[^}]+\}|<[^>]+>/.test(text);
211+
212+
// Determine if this is a download script
213+
if (text.includes('https://www.influxdata.com/d/install_influxdb3.sh')) {
214+
if (text.includes('install_influxdb3.sh enterprise')) {
215+
info.dl = 'enterprise';
216+
} else {
217+
info.dl = 'oss3';
218+
}
219+
} else if (text.includes('docker pull influxdb:3-enterprise')) {
220+
info.dl = 'enterprise';
221+
} else if (text.includes('docker pull influxdb3-core')) {
222+
info.dl = 'oss3';
223+
}
224+
225+
// Find nearest section heading
226+
let element = codeElement;
227+
while (element && element !== document.body) {
228+
element = element.previousElementSibling || element.parentElement;
229+
if (element && element.tagName && /^H[1-6]$/.test(element.tagName)) {
230+
info.sectionTitle = element.textContent.trim();
231+
break;
232+
}
233+
}
234+
235+
return info;
236+
}
237+
87238
/////////////////////////////// FULL WINDOW CODE ///////////////////////////////
88239

89240
/*

build-scripts/build-copilot-instructions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ function buildContributingInstructions() {
4646
applyTo: "content/**/*.md, layouts/**/*.html"
4747
---
4848
49-
# GitHub Copilot Instructions for InfluxData Documentation
49+
# Contributing instructions for InfluxData Documentation
5050
5151
## Purpose and scope
5252
53-
GitHub Copilot should help document InfluxData products
53+
Help document InfluxData products
5454
by creating clear, accurate technical content with proper
5555
code examples, frontmatter, shortcodes, and formatting.
5656

config/staging/hugo.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ minify:
1313
params:
1414
env: staging
1515
environment: staging
16-
server:
16+
server: {
1717
disableLiveReload: true
18+
}
1819

content/influxdb3/core/reference/cli/influxdb3/serve.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ influxdb3 serve [OPTIONS] --node-id <HOST_IDENTIFIER_PREFIX>
2424
## Required parameters
2525

2626
- **node-id**: A unique identifier for your server instance. Must be unique for any hosts sharing the same object store.
27-
- **object-store**: Determines where time series data is stored. _Default is `memory`_.
28-
- **data-dir**: Path for local file storage (required when using `--object-store file`).
27+
- **object-store**: Determines where time series data is stored.
28+
- Other object store parameters depending on the selected `object-store` type.
2929

3030
> [!NOTE]
3131
> `--node-id` supports alphanumeric strings with optional hyphens.

content/influxdb3/core/reference/config-options.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ influxdb3 serve
144144
Specifies which object storage to use to store Parquet files.
145145
This option supports the following values:
146146

147-
- `memory` _(default)_
147+
- `memory`
148148
- `memory-throttled`
149149
- `file`
150150
- `s3`
@@ -171,7 +171,7 @@ Required when using the `file` [object store](#object-store).
171171
#### node-id
172172

173173
Specifies the node identifier used as a prefix in all object store file paths.
174-
This should be unique for any hosts sharing the same object store
174+
Use a unique node identifier for each host sharing the same object store
175175
configuration--for example, the same bucket.
176176

177177
| influxdb3 serve option | Environment variable |
@@ -186,7 +186,7 @@ Limits the number of Parquet files a query can access.
186186

187187
**Default:** `432`
188188

189-
With the default `432` setting and the default [`gen1-duration`](#`gen1-duration`)
189+
With the default `432` setting and the default [`gen1-duration`](#gen1-duration)
190190
setting of 10 minutes, queries can access up to a 72 hours of data, but
191191
potentially less depending on whether all data for a given 10 minute block of
192192
time was ingested during the same period.

content/influxdb3/enterprise/reference/cli/influxdb3/serve.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ influxdb3 serve [OPTIONS] \
2727

2828
- **node-id**: A unique identifier for your server instance. Must be unique for any hosts sharing the same object store.
2929
- **cluster-id**: A unique identifier for your cluster. Must be different from any node-id in your cluster.
30-
- **object-store**: Determines where time series data is stored. _Default is `memory`_.
31-
- **data-dir**: Path for local file storage (required when using `--object-store file`).
30+
- **object-store**: Determines where time series data is stored.
31+
- Other object store parameters depending on the selected `object-store` type.
3232

3333
> [!NOTE]
3434
> `--node-id` and `--cluster-id` support alphanumeric strings with optional hyphens.

content/influxdb3/enterprise/reference/config-options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ export DATABASE_NODE=node0 && influxdb3 serve \
263263
Specifies which object storage to use to store Parquet files.
264264
This option supports the following values:
265265

266-
- `memory` _(default)_: Effectively no object persistence
266+
- `memory`: Effectively no object persistence
267267
- `memory-throttled`: Like `memory` but with latency and throughput that somewhat resembles a cloud object store
268268
- `file`: Stores objects in the local filesystem (must also set `--data-dir`)
269269
- `s3`: Amazon S3 (must also set `--bucket`, `--aws-access-key-id`, `--aws-secret-access-key`, and possibly `--aws-default-region`)

content/shared/influxdb3-get-started/setup.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,17 @@ Provide the following:
4444
- `--object-store`: Specifies the type of object store to use.
4545
InfluxDB supports the following:
4646

47-
- `file` _(default)_: local file system
47+
- `file`: local file system
4848
- `memory`: in memory _(no object persistence)_
4949
- `memory-throttled`: like `memory` but with latency and throughput that
5050
somewhat resembles a cloud-based object store
5151
- `s3`: AWS S3 and S3-compatible services like Ceph or Minio
5252
- `google`: Google Cloud Storage
5353
- `azure`: Azure Blob Storage
5454

55+
- Other object store parameters depending on the selected `object-store` type.
56+
For example, if you use `s3`, you must provide the bucket name and credentials.
57+
5558
> [!Note]
5659
> #### Diskless architecture
5760
>

0 commit comments

Comments
 (0)