mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 20:13:40 +02:00
indent fix
This commit is contained in:
parent
301aba06a3
commit
a048f6f7d5
1 changed files with 176 additions and 183 deletions
|
@ -100,7 +100,8 @@ const html_reg_returnSize = /<h5>Returns:<\/h5>/g;
|
|||
const html_reg_returnSize_replace = '<h6>Returns:<\/h6>';
|
||||
const html_reg_depreciated = /(<dt class="important tag-deprecated"[\s\S]+?<\/dt>[\s\S]+?)(<dd>)([\s\S]+?<ul[\s\S]+?<li>)([\s\S]+?)(<\/ul>[\s\S]+?)(<\/dd>)/g;
|
||||
const html_reg_depreciated_replace = '<em><strong>$1</strong><div>$4</div></em>'
|
||||
// Procedural functions
|
||||
|
||||
// Procedural functions
|
||||
|
||||
//remove .html from non http links
|
||||
function removeHTML(match, p1, p2, p3) {
|
||||
|
@ -329,8 +330,8 @@ function makeGroupTOC(group) {
|
|||
return htmlGroup.join("\n");
|
||||
}
|
||||
|
||||
// Handle Class TOCS
|
||||
function makeClassTOC(group){
|
||||
// Handle Class TOCS
|
||||
function makeClassTOC(group){
|
||||
let linkArray = []
|
||||
group.forEach( item => {
|
||||
linkArray.push(`<div><h5>${item.type}</h5></div>`)
|
||||
|
@ -345,10 +346,10 @@ function makeGroupTOC(group) {
|
|||
linkArray.push("<br>");
|
||||
})
|
||||
return linkArray.join("\n");
|
||||
}
|
||||
}
|
||||
|
||||
// Extract IDS for TOC
|
||||
function extractIDs(groupToExtract){
|
||||
// Extract IDS for TOC
|
||||
function extractIDs(groupToExtract){
|
||||
let firstLine = "";
|
||||
let id = "";
|
||||
let extractedIDs = [];
|
||||
|
@ -364,12 +365,12 @@ function makeGroupTOC(group) {
|
|||
}
|
||||
})
|
||||
return extractedIDs;
|
||||
}
|
||||
}
|
||||
|
||||
// Helper for splitting up html
|
||||
// Takes: Content to split, SearchTerm to Split by, and term to End Splitting By
|
||||
// Returns: [newContent after Split, Array of extracted ]
|
||||
function splitBy(content, searchTerm, endSplitTerm, title){
|
||||
// Helper for splitting up html
|
||||
// Takes: Content to split, SearchTerm to Split by, and term to End Splitting By
|
||||
// Returns: [newContent after Split, Array of extracted ]
|
||||
function splitBy(content, searchTerm, endSplitTerm, title){
|
||||
let foundArray = [];
|
||||
let curIndex = -1;
|
||||
let afterCurSearchIndex = -1
|
||||
|
@ -424,10 +425,10 @@ function makeGroupTOC(group) {
|
|||
content = append(content, html_reg_findByArticleClose, classHeader, true);
|
||||
}
|
||||
return [content, foundArray];
|
||||
}
|
||||
}
|
||||
|
||||
// Split the signals and methods [Might make this more generic]
|
||||
function splitMethodsSignals(allItemToSplit){
|
||||
// Split the signals and methods [Might make this more generic]
|
||||
function splitMethodsSignals(allItemToSplit){
|
||||
let methodArray = [];
|
||||
let signalArray = [];
|
||||
|
||||
|
@ -441,22 +442,22 @@ function makeGroupTOC(group) {
|
|||
}
|
||||
})
|
||||
return [methodArray, signalArray];
|
||||
}
|
||||
}
|
||||
|
||||
// Helper to append
|
||||
// Takes content, the search term to appendTo, the content to append,
|
||||
// and bool if the append is before the found area
|
||||
function append(content, searchTermToAppendto, contentToAppend, appendBefore){
|
||||
// Helper to append
|
||||
// Takes content, the search term to appendTo, the content to append,
|
||||
// and bool if the append is before the found area
|
||||
function append(content, searchTermToAppendto, contentToAppend, appendBefore){
|
||||
let contentArray = content.split("\n");
|
||||
let foundIndex = findArrayTrim(contentArray, searchTermToAppendto)
|
||||
foundIndex = appendBefore ? foundIndex : foundIndex +1
|
||||
|
||||
contentArray.splice(foundIndex,0,contentToAppend)
|
||||
return contentArray.join("\n")
|
||||
}
|
||||
}
|
||||
|
||||
// Helper function for append
|
||||
function findArrayTrim(array, searchTerm){
|
||||
// Helper function for append
|
||||
function findArrayTrim(array, searchTerm){
|
||||
var index = -1;
|
||||
for (var i = 0; i < array.length; i++){
|
||||
index = array[i].trim().indexOf(searchTerm.trim());
|
||||
|
@ -465,7 +466,7 @@ function makeGroupTOC(group) {
|
|||
}
|
||||
}
|
||||
return index;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove grav directory if exists to make sure old files aren't kept
|
||||
if (fs.existsSync(dir_grav)){
|
||||
|
@ -486,10 +487,8 @@ baseMDDirectories.forEach( md => {
|
|||
})
|
||||
|
||||
// Read jsdoc output folder and process html files
|
||||
let links = [];
|
||||
let unTouchedLinks = [];
|
||||
|
||||
let files = fs.readdirSync(dir_out);
|
||||
|
||||
// Create initial Group name member map to handle individual link
|
||||
files.forEach(function (file){
|
||||
let curSource = path.join(dir_out, file);
|
||||
|
@ -534,7 +533,6 @@ files.forEach(function (file, index){
|
|||
.replace(html_reg_static,"") // Remove static from the file names
|
||||
.replace(html_reg_title,"") // Remove title
|
||||
.replace(html_reg_objectHeader,"") // Remove extra Object Header
|
||||
// .replace(html_reg_htmlExt,"")
|
||||
.replace(html_reg_dlClassDetails, "") // Remove unneccsary dlClassDetails Tag
|
||||
.replace(html_reg_allNonHTTPLinks, removeHTML) // Remove the .html extension from all links
|
||||
.replace(html_reg_allNonHTTPLinks, allLinksToLowerCase) // Turn all links into lowercase before ID tags
|
||||
|
@ -582,7 +580,6 @@ files.forEach(function (file, index){
|
|||
let splitMethods = processedMethodsSignalsAndTypeDefs[0];
|
||||
let splitSignals = processedMethodsSignalsAndTypeDefs[1];
|
||||
let splitTypeDefinitionIDS;
|
||||
// let splitDescription = processedMethodsSignalsAndTypeDefs[3];
|
||||
let splitMethodIDS = extractIDs(splitMethods);
|
||||
let splitSignalIDS = extractIDs(splitSignals);
|
||||
if (foundTypeDefinitions){
|
||||
|
@ -590,12 +587,9 @@ files.forEach(function (file, index){
|
|||
}
|
||||
let arrayToPassToClassToc = [];
|
||||
|
||||
// if (splitDescription) {
|
||||
// currentContent = append(currentContent, html_reg_containerOverview, splitDescription);
|
||||
// }
|
||||
if (splitMethods.length > 0) {
|
||||
arrayToPassToClassToc.push({type: "Methods", array: splitMethodIDS});
|
||||
// Add the Signals header to the Signals HTML
|
||||
// Add the Methods header to the Methods HTML
|
||||
splitMethods.unshift(html_reg_findByMethod_replace)
|
||||
currentContent = append(currentContent, html_reg_findByArticleClose, splitMethods.join('\n'), true);
|
||||
}
|
||||
|
@ -607,7 +601,7 @@ files.forEach(function (file, index){
|
|||
}
|
||||
if (foundTypeDefinitions && foundTypeDefinitions.length > 0) {
|
||||
arrayToPassToClassToc.push({type: "Type Definitions", array: splitTypeDefinitionIDS});
|
||||
// Add the Signals header to the Signals HTML
|
||||
// Add the Type Defs header to the Type Defs HTML
|
||||
foundTypeDefinitions.unshift(html_reg_typeDefinitonsTitle_replace)
|
||||
currentContent = append(currentContent, html_reg_findByArticleClose, foundTypeDefinitions.join('\n'), true);
|
||||
}
|
||||
|
@ -616,7 +610,6 @@ files.forEach(function (file, index){
|
|||
if (groupName === "Global"){
|
||||
currentContent = append(currentContent, html_reg_findByTitle, classTOC);
|
||||
} else if (htmlTitle === "Controller") {
|
||||
// currentContent = currentContent.replace(html_reg_availableIn, "");
|
||||
let curatedList = currentContent.match(html_reg_findControllerCuratedList);
|
||||
currentContent = currentContent.replace(html_reg_findControllerCuratedList, "");
|
||||
let entityMethods = currentContent.match(html_reg_findEntityMethods);
|
||||
|
|
Loading…
Reference in a new issue