mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-3279] Initial refactoring of doc tools (#3541)
* [ADF-3279] Added timing option * [ADF-3279] Updated to keep md files in memory during processing * [ADF-3279] Changed read phase to use stored Markdown trees * [ADF-3279] Renamed tool functions and removed obsolete ones * [ADF-3279] Added progress bar and better error message handling
This commit is contained in:
committed by
Eugenio Romano
parent
0255da80a4
commit
821916fbd7
@@ -17,15 +17,18 @@ const maxTocHeadingDepth = 3;
|
||||
var templateFolder = path.resolve("tools", "doc", "templates");
|
||||
|
||||
module.exports = {
|
||||
"initPhase": initPhase,
|
||||
"readPhase": readPhase,
|
||||
"aggPhase": aggPhase,
|
||||
"updatePhase": updatePhase
|
||||
"processDocs": processDocs
|
||||
}
|
||||
|
||||
|
||||
function processDocs(mdCache, aggData, errorMessages) {
|
||||
var pathnames = Object.keys(mdCache);
|
||||
|
||||
pathnames.forEach(pathname => {
|
||||
updateFile(mdCache[pathname].mdOutTree, pathname, aggData, errorMessages);
|
||||
});
|
||||
}
|
||||
|
||||
function initPhase(aggData) {}
|
||||
function readPhase(tree, pathname, aggData) {}
|
||||
function aggPhase(aggData) {}
|
||||
|
||||
|
||||
// Find an existing Contents section or add a new empty one if needed.
|
||||
@@ -80,7 +83,11 @@ function establishContentsSection(mdTree) {
|
||||
return numTocHeadings;
|
||||
}
|
||||
|
||||
function updatePhase(tree, pathname, aggData) {
|
||||
|
||||
|
||||
|
||||
|
||||
function updateFile(tree, pathname, _aggData, _errorMessages) {
|
||||
if (path.basename(pathname, ".md").match(/README|versionIndex/)) {
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user