mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-1955] Updated doc index and script for new folder structure (#2659)
This commit is contained in:
committed by
Eugenio Romano
parent
ca6423d638
commit
ea5d7f5eac
@@ -2,6 +2,8 @@ var fs = require('fs');
|
||||
var path = require('path');
|
||||
|
||||
var angFilenameRegex = /([a-zA-Z0-9\-]+)\.((component)|(directive)|(model)|(pipe)|(service)|(widget))\.ts/;
|
||||
var searchFolderOmitRegex = /(mock)|(i18n)|(assets)|(styles)/;
|
||||
var libFolderOmitRegex = /config/;
|
||||
|
||||
var indexFileName = path.resolve('..', 'docs', 'README.md');
|
||||
var summaryFileName = path.resolve('..', 'docs', 'summary.json');
|
||||
@@ -81,7 +83,7 @@ function searchLibraryRecursive(libData, folderPath) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (info.isDirectory()) {
|
||||
} else if (info.isDirectory() && !items[i].match(searchFolderOmitRegex)) {
|
||||
searchLibraryRecursive(libData, itemPath);
|
||||
}
|
||||
}
|
||||
@@ -173,8 +175,8 @@ function buildIndexSection(name, documented, undocumented) {
|
||||
var libFileName = path.basename(libFilePath, '.ts');
|
||||
var nameSections = libFileName.split('.');
|
||||
var visibleName = tidyName(nameSections[0]) + ' ' + nameSections[1];
|
||||
var relPath = libFilePath.substr(libFilePath.indexOf('/ng2-') + 1);
|
||||
var mdListItem = '- [*' + visibleName + '](../' + relPath + ')';
|
||||
var relPath = libFilePath.substr(libFilePath.indexOf('/lib'));
|
||||
var mdListItem = '- [*' + visibleName + '](..' + relPath + ')';
|
||||
listItems.push(mdListItem);
|
||||
}
|
||||
|
||||
@@ -194,7 +196,7 @@ for (var i = 0; i < rootItems.length; i++) {
|
||||
var itemPath = path.resolve(rootItems[i]);
|
||||
var info = fs.statSync(itemPath);
|
||||
|
||||
if (info.isDirectory() && rootItems[i].match(/ng2-/)) {
|
||||
if (info.isDirectory() && !rootItems[i].match(libFolderOmitRegex)) {
|
||||
libs[rootItems[i]] = {
|
||||
componentsWithDocs: [], componentsWithoutDocs: [],
|
||||
directivesWithDocs: [], directivesWithoutDocs: [],
|
||||
@@ -204,7 +206,7 @@ for (var i = 0; i < rootItems.length; i++) {
|
||||
widgetsWithDocs: [], widgetsWithoutDocs: [],
|
||||
};
|
||||
|
||||
searchLibraryRecursive(libs[rootItems[i]], path.resolve(itemPath, 'src'));
|
||||
searchLibraryRecursive(libs[rootItems[i]], path.resolve(itemPath));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user