This is an automated email from the ASF dual-hosted git repository.

jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git


The following commit(s) were added to refs/heads/master by this push:
     new 399123884 Debugging doc build issue.
399123884 is described below

commit 399123884947951cd76eed31c6a5733d2c965919
Author: James Bognar <[email protected]>
AuthorDate: Tue Sep 23 09:47:00 2025 -0400

    Debugging doc build issue.
---
 juneau-docs-poc/docusaurus.config.ts               | 43 ++++++++++------------
 .../src/plugins/remark-version-replacer.js         | 40 ++++++++++++++++----
 2 files changed, 51 insertions(+), 32 deletions(-)

diff --git a/juneau-docs-poc/docusaurus.config.ts 
b/juneau-docs-poc/docusaurus.config.ts
index b136947e9..7605c79a1 100644
--- a/juneau-docs-poc/docusaurus.config.ts
+++ b/juneau-docs-poc/docusaurus.config.ts
@@ -18,8 +18,6 @@ import remarkJuneauLinks from 
'./src/plugins/remark-juneau-links';
 const remarkVersionReplacer = require('./src/plugins/remark-version-replacer');
 
 // This runs in Node.js - Don't use client-side code here (browser APIs, 
JSX...)
-console.log('🚀 Docusaurus config loading...');
-console.log('📦 remarkVersionReplacer loaded:', typeof remarkVersionReplacer);
 
 const config: Config = {
   title: 'Apache Juneau',
@@ -69,28 +67,25 @@ const config: Config = {
           // Remove this to remove the "edit this page" links.
           editUrl:
             
'https://github.com/apache/juneau/tree/main/juneau-docs-poc/juneau-documentation/',
-          remarkPlugins: (() => {
-            console.log('🔧 Setting up remark plugins...');
-            return [
-              [remarkJuneauLinks, {
-                packageAbbreviations: {
-                  'oaj': 'org.apache.juneau',
-                  'oajr': 'org.apache.juneau.rest',
-                  'oajrc': 'org.apache.juneau.rest.client',
-                  'oajrs': 'org.apache.juneau.rest.server',
-                  'oajrss': 'org.apache.juneau.rest.server.springboot',
-                  'oajrm': 'org.apache.juneau.rest.mock',
-                  'oajmc': 'org.apache.juneau.microservice.core',
-                  'oajmj': 'org.apache.juneau.microservice.jetty',
-                },
-                javadocBaseUrl: '../apidocs'
-              }],
-              [remarkVersionReplacer, {
-                version: '9.0.1',
-                apiDocsUrl: '../apidocs'
-              }]
-            ];
-          })()
+          remarkPlugins: [
+            [remarkJuneauLinks, {
+              packageAbbreviations: {
+                'oaj': 'org.apache.juneau',
+                'oajr': 'org.apache.juneau.rest',
+                'oajrc': 'org.apache.juneau.rest.client',
+                'oajrs': 'org.apache.juneau.rest.server',
+                'oajrss': 'org.apache.juneau.rest.server.springboot',
+                'oajrm': 'org.apache.juneau.rest.mock',
+                'oajmc': 'org.apache.juneau.microservice.core',
+                'oajmj': 'org.apache.juneau.microservice.jetty',
+              },
+              javadocBaseUrl: '../apidocs'
+            }],
+            [remarkVersionReplacer, {
+              version: '9.0.1',
+              apiDocsUrl: '../apidocs'
+            }]
+          ]
         },
         blog: {
           showReadingTime: true,
diff --git a/juneau-docs-poc/src/plugins/remark-version-replacer.js 
b/juneau-docs-poc/src/plugins/remark-version-replacer.js
index 1176aa227..6b010923c 100644
--- a/juneau-docs-poc/src/plugins/remark-version-replacer.js
+++ b/juneau-docs-poc/src/plugins/remark-version-replacer.js
@@ -33,23 +33,47 @@ function remarkVersionReplacer(options = {}) {
   console.log(`🔧 remarkVersionReplacer initialized with version: ${version}, 
apiDocsUrl: ${apiDocsUrl}`);
   
   return (tree, file) => {
-    console.log(`📄 Processing file: ${file.path || 'unknown'}`);
+    const fileName = file.path || 'unknown';
+    console.log(`📄 Processing file: ${fileName}`);
     
-    // Replace placeholders in the entire file content before parsing
-    if (file.contents) {
-      const originalContent = file.contents;
-      const hasApiDocs = originalContent.includes('{{API_DOCS}}');
-      const hasVersion = originalContent.includes('{{JUNEAU_VERSION}}');
+    // Try different possible content properties
+    const content = file.contents || file.value || file.data;
+    
+    // Show content sample for files that should have placeholders
+    if (fileName.includes('10.01.00.JuneauRestClientBasics')) {
+      console.log(`🔍 SPECIFIC FILE DEBUG - ${fileName}:`);
+      console.log(`📋 File object keys: ${Object.keys(file).join(', ')}`);
+      console.log(`📋 Content type: ${typeof content}`);
+      if (content) {
+        const contentStr = String(content);
+        console.log(`📋 Content length: ${contentStr.length}`);
+        console.log(`📋 First 200 chars: ${contentStr.substring(0, 200)}`);
+        console.log(`📋 Contains {{API_DOCS}}: 
${contentStr.includes('{{API_DOCS}}')}`);
+        console.log(`📋 Contains API_DOCS (no braces): 
${contentStr.includes('API_DOCS')}`);
+        console.log(`📋 Contains {API_DOCS}: 
${contentStr.includes('{API_DOCS}')}`);
+      }
+    }
+    
+    if (content) {
+      const hasApiDocs = content.includes('{{API_DOCS}}');
+      const hasVersion = content.includes('{{JUNEAU_VERSION}}');
       
       if (hasApiDocs || hasVersion) {
         console.log(`🎯 Found placeholders in ${file.path || 'unknown'}: 
API_DOCS=${hasApiDocs}, VERSION=${hasVersion}`);
       }
       
-      file.contents = replaceInString(file.contents, version, apiDocsUrl);
+      const replacedContent = replaceInString(content, version, apiDocsUrl);
+      
+      // Update the content property we found
+      if (file.contents) file.contents = replacedContent;
+      if (file.value) file.value = replacedContent;
+      if (file.data) file.data = replacedContent;
       
-      const stillHasPlaceholders = file.contents.includes('{{API_DOCS}}') || 
file.contents.includes('{{JUNEAU_VERSION}}');
+      const stillHasPlaceholders = replacedContent.includes('{{API_DOCS}}') || 
replacedContent.includes('{{JUNEAU_VERSION}}');
       if (stillHasPlaceholders) {
         console.log(`⚠️  WARNING: Still has unreplaced placeholders in 
${file.path || 'unknown'}`);
+      } else if (hasApiDocs || hasVersion) {
+        console.log(`✅ Successfully replaced placeholders in ${file.path || 
'unknown'}`);
       }
     }
     // No need for AST traversal since string replacement handles all cases

Reply via email to