Skip to content

🚀 Add Structures Template #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 18, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions doc-templates/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ html {

body {
font-family: "Poppins", sans-serif;
overflow: hidden;
}

#docs-body {
background-color: var(--bg-color);
display: grid;
/*
Expand Down Expand Up @@ -256,6 +260,19 @@ 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);
color: white;
}

/* Pattern right section list items */

.item-details:nth-child(1) ul li:nth-child(odd) {
Expand Down Expand Up @@ -669,7 +686,7 @@ td ul {


@media (max-width: 1200px) {
body {
#docs-body {
grid-template-columns: 20% minmax(80%, 100%);
}

Expand Down Expand Up @@ -712,7 +729,7 @@ td ul {


@media (max-width: 1024px) {
body {
#docs-body {
grid-template-columns: 20% minmax(80%, 100%);
}

Expand All @@ -724,7 +741,7 @@ td ul {
}

@media (max-width: 768px) {
body {
#docs-body {
grid-template-columns: 20% minmax(80%, 100%);
}

Expand All @@ -751,7 +768,7 @@ td ul {
}

@media (max-width: 550px) {
body {
#docs-body {
grid-template-columns: 0 100%;
}

Expand Down Expand Up @@ -1168,7 +1185,7 @@ pre code { /* override styling for code blocks */

#cookies-bar {
position: sticky;
margin: 0 -8vw;
margin: 0;
bottom: 0;
background-color: #353535;
color: white;
Expand Down
7 changes: 7 additions & 0 deletions doc-templates/events.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<h1 id="nav-title">Events</h1>

<div id="content">

<p class="box-title-red">Note:</p>
<p class="box-red" style="margin-bottom: 25px;">
You can specify the event priority after each event syntax using the following syntax <code>[with priority (lowest|low|normal|high|highest|monitor)]</code> e.g. <code>on spawn with priority lowest</code>.<br>
Note that not all of the events support event priority feature and they will throw an error.
</p>

${generate events desc_full.html}
</div>
6 changes: 3 additions & 3 deletions doc-templates/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -390,7 +390,7 @@ if (examples) {

// <> Cookies Accecpt
if (!isCookiesAccepted) {
content.insertAdjacentHTML('beforeend', `<div id="cookies-bar"> <p> 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. </p><div style="padding: 10px; white-space: nowrap;"> <button id="cookies-accept">Accept</button> <button id="cookies-deny">Deny</button> </div></div>`);
document.body.insertAdjacentHTML('beforeend', `<div id="cookies-bar"> <p> 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. </p><div style="padding: 10px; white-space: nowrap;"> <button id="cookies-accept">Accept</button> <button id="cookies-deny">Deny</button> </div></div>`);
}

let cookiesBar = document.querySelector("#cookies-bar");;
Expand Down
6 changes: 6 additions & 0 deletions doc-templates/structures.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<h1 id="nav-title">Structures</h1>

<div id="content">

${generate structures desc_full.html}
</div>
25 changes: 14 additions & 11 deletions doc-templates/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,20 @@

</head>
<body>
<!-- loaded inside body without defer to fix theme flicker -->
<script src="./js/theme-switcher.js"></script>

${include navbar.html}
<nav id="side-nav">
<div id="nav-contents">
${generate ${pagename} desc_nav.html}
</div>
</nav>

${content}
<div id="docs-body">
<!-- loaded inside body without defer to fix theme flicker -->
<script src="./js/theme-switcher.js"></script>

${include navbar.html}
<nav id="side-nav">
<div id="nav-contents">
${generate ${pagename} desc_nav.html}
</div>
</nav>

${content}


</div>
</body>
</html>
13 changes: 13 additions & 0 deletions doc-templates/templates/desc_full.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ <h1 style="display: inline-block">${element.name}</h1> <a href="#${element.id}"
</td>
</tr>

${if structure-required-entrydata}
<tr class="item-details">
<td class="item-table-label">Required Entries:</td>
<td>${element.structure-required-entrydata}</td>
</tr>

${end} ${if structure-optional-entrydata}
<tr class="item-details">
<td class="item-table-label">Optional Entries:</td>
<td>${element.structure-optional-entrydata}</td>
</tr>

${end}
<tr class="item-details">
<td class="item-table-label">Since:</td>
<td>${element.since}</td>
Expand Down
1 change: 1 addition & 0 deletions doc-templates/templates/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<a href="effects.html">Effects</a>
<a href="expressions.html">Expressions</a>
<a href="classes.html">Types</a>
<a href="structures.html">Structures</a>
<a href="functions.html">Functions</a>
</div>
</div>
Expand Down