Books Bug Fixed

This commit is contained in:
Luis Fernando Molina committed 2021-01-04 10:34:43 +01:00
1 parent c6212aac2b
commit 2ba163118e
3 files changed
+25 -1

No files matched your search

+2 -1
View File
@@ -1145,7 +1145,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
folder = 'Docs-Topics'
break
}
case 'DocsBooksSchema': {
case 'DocsBookSchema': {
folder = 'Docs-Books'
break
}
@@ -1162,6 +1162,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
let schema = JSON.stringify(schemaArray)
respondWithContent(schema, httpResponse)
} catch (err) {
console.log('Could not send Schema:' ,filePath, schemaType)
console.log(err.stack)
respondWithContent("[]", httpResponse)
}
@@ -0,0 +1,12 @@
{
"type": "How To Trade ",
"definition": {
"text": "Write here the summary / definition of this Book."
},
"paragraphs": [
{
"style": "Text",
"text": "Left click and Edit to enter edit mode and change this text. ENTER to write new paragraphs. ESC to exit edit mode."
}
]
}
@@ -57,6 +57,17 @@ function newSuperalgosDocsSearchEngine() {
indexDocument(documentIndex)
thisObject.docsIndex.push(documentIndex)
}
/* Search in Books */
for (let i = 0; i < SCHEMAS_BY_PROJECT.get(project).array.docsBookSchema.length; i++) {
documentIndex = {
phraseCount: {}, // here we have an object with properties matching it paragraph style, and each property is a map of phrases and their total count.
docsSchemaDocument: SCHEMAS_BY_PROJECT.get(project).array.docsBookSchema[i],
category: 'Book',
project: project
}
indexDocument(documentIndex)
thisObject.docsIndex.push(documentIndex)
}
/* Search in Workspace */
for (let i = 0; i < SCHEMAS_BY_PROJECT.get(project).array.workspaceSchema.length; i++) {
documentIndex = {