diff --git a/doc-templates/css/styles.css b/doc-templates/css/styles.css index a13696ee29f..eaf92d8dd28 100644 --- a/doc-templates/css/styles.css +++ b/doc-templates/css/styles.css @@ -119,6 +119,10 @@ html { body { font-family: "Poppins", sans-serif; + overflow: hidden; +} + +#docs-body { background-color: var(--bg-color); display: grid; /* @@ -256,6 +260,18 @@ a:visited { color: white; } +.type-Structure { + border-left: 5px solid rgb(0, 219, 255); +} + +.type-Structure .item-type { + color: rgb(0, 219, 255); +} + +.type-Structure .item-examples p { + background-color: rgb(0, 219, 255); +} + /* Pattern right section list items */ .item-details:nth-child(1) ul li:nth-child(odd) { @@ -669,7 +685,7 @@ td ul { @media (max-width: 1200px) { - body { + #docs-body { grid-template-columns: 20% minmax(80%, 100%); } @@ -712,7 +728,7 @@ td ul { @media (max-width: 1024px) { - body { + #docs-body { grid-template-columns: 20% minmax(80%, 100%); } @@ -724,7 +740,7 @@ td ul { } @media (max-width: 768px) { - body { + #docs-body { grid-template-columns: 20% minmax(80%, 100%); } @@ -751,7 +767,7 @@ td ul { } @media (max-width: 550px) { - body { + #docs-body { grid-template-columns: 0 100%; } @@ -1168,7 +1184,7 @@ pre code { /* override styling for code blocks */ #cookies-bar { position: sticky; - margin: 0 -8vw; + margin: 0; bottom: 0; background-color: #353535; color: white; diff --git a/doc-templates/events.html b/doc-templates/events.html index 119fd0e558b..7f8adee7000 100644 --- a/doc-templates/events.html +++ b/doc-templates/events.html @@ -1,5 +1,12 @@

Events

+ +

Note:

+

+ You can specify the event priority after each event syntax using the following syntax [with priority (lowest|low|normal|high|highest|monitor)] e.g. on spawn with priority lowest.
+ Note that not all of the events support event priority feature and they will throw an error. +

+ ${generate events desc_full.html}
diff --git a/doc-templates/js/main.js b/doc-templates/js/main.js index 0b48675990d..802cea11505 100644 --- a/doc-templates/js/main.js +++ b/doc-templates/js/main.js @@ -90,7 +90,7 @@ document.querySelectorAll(".new-element").forEach((e) => { // <> Search Bar const versionComparePattern = /.*?(\d\.\d(?:\.\d|))(\+|-|).*/gi; const versionPattern = / ?v(?:ersion|):(\d\.\d(?:\.\d|-(?:beta|alpha|dev)\d*|))(\+|-|)/gi; -const typePattern = / ?t(?:ype|):(condition|expression|type|effect|event|section|effectsection|function)/gi; +const typePattern = / ?t(?:ype|):(\w+)/gi; const newPattern = / ?is:(new)/gi; const resultsFoundText = "result(s) found"; @@ -241,7 +241,7 @@ function searchNow(value = "") { let regex = new RegExp(searchValue, "gi") let name = document.querySelectorAll(`#${e.id} .item-title h1`)[0].textContent // Syntax Name let desc = document.querySelectorAll(`#${e.id} .item-description`)[0].textContent // Syntax Desc - let keywords = e.getAttribute("data-keywords") + let keywords = e.getAttribute("data-keywords") let id = e.id // Syntax ID let filtersFound = false; @@ -285,7 +285,7 @@ function searchNow(value = "") { filtersFound = true if ((regex.test(pattern.textContent.replaceAll("[ ]", " ")) || regex.test(name) || - regex.test(desc) || regex.test(keywords) || "#" + id == searchValue || searchValue == "") && filtersFound) { // Replacing '[ ]' will improve some searching cases such as 'off[ ]hand' + regex.test(desc) || regex.test(keywords) || "#" + id.toLowerCase() == searchValue.toLowerCase() || searchValue == "") && filtersFound) { // Replacing '[ ]' will improve some searching cases such as 'off[ ]hand' pass = true break; // Performance } @@ -390,7 +390,7 @@ if (examples) { // <> Cookies Accecpt if (!isCookiesAccepted) { - content.insertAdjacentHTML('beforeend', `

We use cookies and local storage to enhance your browsing experience and store github related statistics. By clicking "Accept", you consent to our use of cookies and local storage.

`); + document.body.insertAdjacentHTML('beforeend', `

We use cookies and local storage to enhance your browsing experience and store github related statistics. By clicking "Accept", you consent to our use of cookies and local storage.

`); } let cookiesBar = document.querySelector("#cookies-bar");; diff --git a/doc-templates/structures.html b/doc-templates/structures.html new file mode 100644 index 00000000000..61adabbe56a --- /dev/null +++ b/doc-templates/structures.html @@ -0,0 +1,6 @@ +

Structures

+ +
+ + ${generate structures desc_full.html} +
\ No newline at end of file diff --git a/doc-templates/template.html b/doc-templates/template.html index aace63cb500..e7ed453e13f 100644 --- a/doc-templates/template.html +++ b/doc-templates/template.html @@ -35,17 +35,20 @@ - - - - ${include navbar.html} - - - ${content} +
+ + + + ${include navbar.html} + + + ${content} + +
diff --git a/doc-templates/templates/desc_full.html b/doc-templates/templates/desc_full.html index 2a82c110f95..d68d5c97b4f 100644 --- a/doc-templates/templates/desc_full.html +++ b/doc-templates/templates/desc_full.html @@ -14,6 +14,19 @@

${element.name}

+ ${if structure-required-entrydata} + + Required Entries: + ${element.structure-required-entrydata} + + + ${end} ${if structure-optional-entrydata} + + Optional Entries: + ${element.structure-optional-entrydata} + + + ${end} Since: ${element.since} diff --git a/doc-templates/templates/navbar.html b/doc-templates/templates/navbar.html index 6d34dc12128..e2e00ca2945 100644 --- a/doc-templates/templates/navbar.html +++ b/doc-templates/templates/navbar.html @@ -10,6 +10,7 @@ Effects Expressions Types + Structures Functions