@redpanda-data/docs-extensions-and-macros 4.6.8 → 4.6.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/doc-tools.js CHANGED
@@ -273,13 +273,14 @@ After installation, verify with:
273
273
 
274
274
  // Check for C++ standard library headers (critical for tree-sitter compilation)
275
275
  let tempDir = null;
276
+ let compileCmd = null;
276
277
  try {
277
278
  const testProgram = '#include <functional>\nint main() { return 0; }';
278
279
  tempDir = require('fs').mkdtempSync(require('path').join(require('os').tmpdir(), 'cpp-test-'));
279
280
  const tempFile = require('path').join(tempDir, 'test.cpp');
280
281
  require('fs').writeFileSync(tempFile, testProgram);
281
282
 
282
- const compileCmd = cppCompiler === 'gcc' ? 'gcc' : 'clang++';
283
+ compileCmd = cppCompiler === 'gcc' ? 'gcc' : 'clang++';
283
284
  execSync(`${compileCmd} -x c++ -fsyntax-only "${tempFile}"`, { stdio: 'ignore' });
284
285
  require('fs').rmSync(tempDir, { recursive: true, force: true });
285
286
  } catch {
@@ -293,23 +294,23 @@ After installation, verify with:
293
294
  }
294
295
  fail(`C++ standard library headers are missing or incomplete.
295
296
 
296
- This error typically means:
297
- 1. No C++ compiler is installed, OR
298
- 2. Xcode Command Line Tools are missing/incomplete
297
+ 1. **Test if the issue exists**:
298
+ echo '#include <functional>' | ${compileCmd} -x c++ -fsyntax-only -
299
299
 
300
- To fix this on macOS:
301
- 1. Install Xcode Command Line Tools:
302
- xcode-select --install
303
-
304
- 2. If already installed, reset the developer path:
300
+ 2. **If the test fails, try these fixes in order**:
301
+ **Fix 1**: Reset developer path
305
302
  sudo xcode-select --reset
306
303
 
307
- 3. For Xcode users, ensure correct path:
308
- sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
304
+ **Fix 2**: Force reinstall Command Line Tools
305
+ sudo rm -rf /Library/Developer/CommandLineTools
306
+ xcode-select --install
309
307
 
310
- 4. Verify the fix:
311
- echo '#include <functional>' | ${cppCompiler || 'clang++'} -x c++ -fsyntax-only -
308
+ Complete the GUI installation dialog that appears.
312
309
 
310
+ 3. **Verify the fix**:
311
+ echo '#include <functional>' | ${compileCmd} -x c++ -fsyntax-only -
312
+ If successful, you should see no output and the command should exit with code 0.
313
+ `);
313
314
  }
314
315
  }
315
316
 
@@ -31,7 +31,7 @@ function findRelated(labPage, sourceCategoryList, sourceDeploymentType, logger)
31
31
  const targetCategoryList = pageCategories.split(',').map(c => c.trim());
32
32
  const targetDeploymentType = getDeploymentType(targetAttributes)
33
33
  const categoryMatch = hasMatchingCategory(sourceCategoryList, targetCategoryList)
34
- if (categoryMatch && (!targetDeploymentType ||sourceDeploymentType === targetDeploymentType || (targetDeploymentType === 'Docker' && !sourceDeploymentType))) {
34
+ if (categoryMatch && isCompatibleDeployment(sourceDeploymentType, targetDeploymentType)) {
35
35
  return {
36
36
  title: labPage.asciidoc.doctitle,
37
37
  url: labPage.pub.url,
@@ -51,4 +51,21 @@ function getDeploymentType (attributes) {
51
51
 
52
52
  function hasMatchingCategory (sourcePageCategories, targetPageCategories) {
53
53
  return sourcePageCategories.every((category) => targetPageCategories.includes(category))
54
+ }
55
+
56
+ function isCompatibleDeployment (sourceDeploymentType, targetDeploymentType) {
57
+ // If no target deployment type specified, it's compatible with everything
58
+ if (!targetDeploymentType) return true
59
+
60
+ // Cloud pages show only cloud labs
61
+ if (sourceDeploymentType === 'Redpanda Cloud') {
62
+ return targetDeploymentType === 'Redpanda Cloud'
63
+ }
64
+
65
+ // All other cases (Kubernetes, Docker, Linux, or no deployment type) show Docker and Kubernetes
66
+ if (targetDeploymentType === 'Docker' || targetDeploymentType === 'Kubernetes') {
67
+ return true
68
+ }
69
+
70
+ return false
54
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redpanda-data/docs-extensions-and-macros",
3
- "version": "4.6.8",
3
+ "version": "4.6.10",
4
4
  "description": "Antora extensions and macros developed for Redpanda documentation.",
5
5
  "keywords": [
6
6
  "antora",
@@ -1,2 +1,2 @@
1
- tree_sitter==0.20.4
1
+ tree_sitter==0.21.1
2
2
  setuptools>=42.0.0