Skip to content

Add support for foundation category in documentation build process #3599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions scripts/docs/buildDocsCommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const fs = require('fs');

const COMPONENTS_DOCS_DIR = './docs/components';
const SERVICES_DOCS_DIR = './docs/services';
const FOUNDATION_DOCS_DIR = './docs/foundation';

const VALID_COMPONENTS_CATEGORIES = [
'foundation',
Expand Down Expand Up @@ -92,14 +93,22 @@ function processComponents(components) {
content += `${buildOldDocs(component)}\n`;
}


let dirPath;
if (component.category === 'services') {
dirPath = `${SERVICES_DOCS_DIR}`;
} else {
const componentParentDir =
componentParentName || isParentComponent ? `/${componentParentName || componentName}` : '';
dirPath = `${COMPONENTS_DOCS_DIR}/${component.category}${componentParentDir}`;
switch (component.category) {
case 'services': {
dirPath = `${SERVICES_DOCS_DIR}`;
break;
}
case 'foundation': {
dirPath = `${FOUNDATION_DOCS_DIR}`;
break;
}
default: {
const componentParentDir =
componentParentName || isParentComponent ? `/${componentParentName || componentName}` : '';
dirPath = `${COMPONENTS_DOCS_DIR}/${component.category}${componentParentDir}`;
break;
}
}

if (!fs.existsSync(dirPath)) {
Expand Down