diff --git a/Client/WebServer/css/docs.css b/Client/WebServer/css/docs.css index 234488f68..8fbe242b6 100644 --- a/Client/WebServer/css/docs.css +++ b/Client/WebServer/css/docs.css @@ -634,3 +634,12 @@ a:active.docs-search-result-content-record-title { margin-top: 5px!important; } +.docs-topic-index-link { + font-size: 125%; + color: #31708f; +} + +a:hover.docs-topic-index-link { + text-decoration: underline; + cursor: pointer; +} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Topics/contributing-001.json b/Projects/Superalgos/Schemas/Docs-Topics/contributing-001.json index d3e69aa1c..873e58b72 100644 --- a/Projects/Superalgos/Schemas/Docs-Topics/contributing-001.json +++ b/Projects/Superalgos/Schemas/Docs-Topics/contributing-001.json @@ -1,6 +1,7 @@ { - "type": "Contributing - Page 1 Title", + "topic": "Contributing", + "type": "To the Docs", "definition": "There are many ways to contribute", "pageNumber": 1, "paragraphs": [ diff --git a/Projects/Superalgos/Schemas/Docs-Topics/contributing-002.json b/Projects/Superalgos/Schemas/Docs-Topics/contributing-002.json index bc9c287cf..bfd170da1 100644 --- a/Projects/Superalgos/Schemas/Docs-Topics/contributing-002.json +++ b/Projects/Superalgos/Schemas/Docs-Topics/contributing-002.json @@ -1,8 +1,9 @@ { - "type": "Contributing - Page 2 Title", - "definition": "These are other ways to contribute. These are other ways to contribute. These are other ways to contribute. These are other ways to contribute. These are other ways to contribute. These are other ways to contribute. ", - "pageNumber": 1, + "topic": "Contributing", + "type": "Code", + "definition": "These are other ways to contribute. These are other ways to contribute. These are other ways to contribute. These are other ways to contribute. These are other ways to contribute. These are other ways to contribute. s", + "pageNumber": 2, "paragraphs": [ { "style": "Title", diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js b/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js index bb6668719..9d0befe01 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js @@ -709,6 +709,13 @@ function newSuperalgosDocSpace() { return } + if (documentIndex.schemaDocument.topic !== undefined) { + let paragraph = { + style: 'Topic', + text: documentIndex.schemaDocument.topic + } + indexParagraph(paragraph) + } if (documentIndex.schemaDocument.type !== undefined) { let paragraph = { style: 'Type', @@ -808,11 +815,23 @@ function newSuperalgosDocSpace() { if (thisPhraseCount === undefined) { thisPhraseCount = 0 } - if (key === cleanTextForSearch(documentIndex.schemaDocument.type.toLowerCase())) { - documentPoints = documentPoints + thisPhraseCount * 100 + + if (documentIndex.schemaDocument.type !== undefined) { + if (key === cleanTextForSearch(documentIndex.schemaDocument.type.toLowerCase())) { + documentPoints = documentPoints + thisPhraseCount * 100 + } + } + if (documentIndex.schemaDocument.topic !== undefined) { + if (key === cleanTextForSearch(documentIndex.schemaDocument.topic.toLowerCase())) { + documentPoints = documentPoints + thisPhraseCount * 200 + } } switch (style) { + case 'topic': { + documentPoints = documentPoints + thisPhraseCount * 100 + break + } case 'type': { documentPoints = documentPoints + thisPhraseCount * 50 break @@ -967,7 +986,14 @@ function newSuperalgosDocSpace() { HTML = HTML + '
' + result.documentIndex.project + ' > ' + result.documentIndex.documentCategory + path + '
' - HTML = HTML + '' + result.documentIndex.schemaDocument.type + '
' + + let mainLink = '' + if (result.documentIndex.schemaDocument.topic === undefined) { + mainLink = result.documentIndex.schemaDocument.type + } else { + mainLink = result.documentIndex.schemaDocument.topic + ' - Part ' + result.documentIndex.schemaDocument.pageNumber + ' - ' + result.documentIndex.schemaDocument.type + } + HTML = HTML + '' if (result.documentIndex.schemaDocument.definition !== undefined) { HTML = HTML + '' + result.documentIndex.schemaDocument.definition + '
' @@ -1165,7 +1191,14 @@ function newSuperalgosDocSpace() { HTML = HTML + '' // Clickeable Container Ends @@ -1206,6 +1244,38 @@ function newSuperalgosDocSpace() { */ addImages() + function generateMultiPageIndex() { + /* + We will go through all the schema docuents array for the current project and pick + the documents that share the same key thatn the document we are rendering now. + With the info on those picked document we will build the index. + */ + let key = 'auto-generated-index-paragraph-' + paragraphIndex + let paragraph = { + style: "Title", + text: "" + schemaDocument.topic + " Topic Index" + } + renderParagraph(paragraph, key) + paragraphIndex++ + + let schemaArray = SCHEMAS_BY_PROJECT.get(objectBeingRendered.project).array.docsTopicSchema + for (let i = 0; i < schemaArray.length; i++) { + let arrayItem = schemaArray[i] + + if (arrayItem.topic === schemaDocument.topic) { + + paragraph + key = 'auto-generated-index-paragraph-' + paragraphIndex + paragraph = { + style: "Title", + text: "" + arrayItem.pageNumber + '. ' + arrayItem.type + "" + } + paragraphIndex++ + HTML = HTML + '