Skip to content
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

Restyle Docs Site #3935

Merged
merged 29 commits into from
Aug 15, 2021
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b6b2cd7
Restyle Docs Site
AyhamAl-Ali Apr 29, 2021
c882def
Merge branch 'master' into feature/docs-site-styling
AyhamAl-Ali Apr 29, 2021
2d39743
Additions & Fixes
AyhamAl-Ali Apr 30, 2021
be72cb7
Merge remote-tracking branch 'AyhamAl-Ali/feature/docs-site-styling' …
AyhamAl-Ali Apr 30, 2021
153bf55
Copyrights link fix
AyhamAl-Ali May 1, 2021
be8ceaf
Merge branch 'master' into feature/docs-site-styling
AyhamAl-Ali Jul 1, 2021
3eaee4b
Changes as requested
AyhamAl-Ali Jul 2, 2021
c92851c
Merge remote-tracking branch 'AyhamAl-Ali/feature/docs-site-styling' …
AyhamAl-Ali Jul 2, 2021
cef7eb3
Formatting
AyhamAl-Ali Jul 2, 2021
a4365a6
Multiple fixes
AyhamAl-Ali Jul 3, 2021
77985b2
Typo
AyhamAl-Ali Jul 3, 2021
67d0d2a
Forgot this
AyhamAl-Ali Jul 3, 2021
0e6bd06
Multiple fixes
AyhamAl-Ali Jul 3, 2021
a1cd16e
Typo
AyhamAl-Ali Jul 3, 2021
a9f105a
Forgot this
AyhamAl-Ali Jul 3, 2021
e63235d
Merge remote-tracking branch 'AyhamAl-Ali/feature/docs-site-styling' …
AyhamAl-Ali Jul 3, 2021
7c2eb85
Fix title responsivity for smaller screens
AyhamAl-Ali Jul 3, 2021
5ef4a5e
Fix underline and magic styles
AyhamAl-Ali Jul 5, 2021
ba81895
Improved responsivity
AyhamAl-Ali Jul 5, 2021
dcb47a1
Multiple fixes
AyhamAl-Ali Jul 6, 2021
6fff752
#1338
AyhamAl-Ali Jul 27, 2021
5a1a8be
#2543
AyhamAl-Ali Jul 27, 2021
25e442d
Fixes & Improvements
AyhamAl-Ali Aug 3, 2021
996941a
Add anchor click link copy + Notification
AyhamAl-Ali Aug 3, 2021
43f0ea4
Fix `Usable in events` links
AyhamAl-Ali Aug 3, 2021
d33d164
🚀 Biggest update yet?
AyhamAl-Ali Aug 8, 2021
a950c12
Fixed command arguments not escaped
AyhamAl-Ali Aug 10, 2021
73c63bc
As requested (New example & HLJS license)
AyhamAl-Ali Aug 13, 2021
1be24d8
Merge branch 'master' into feature/docs-site-styling
TPGamesNL Aug 15, 2021
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
Binary file added docs/assets/Logo/Skript Logo Circle 2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/Logo/Skript Logo Circle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/Logo/Skript Logo Trans.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/Logo/Skript Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
427 changes: 326 additions & 101 deletions docs/css/styles.css

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions docs/functions.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<h1 id="nav-title">Functions</h1>
TPGamesNL marked this conversation as resolved.
Show resolved Hide resolved

<p class="box">
These functions are defined by Skript. You may also create your own functions!
Tutorial for doing so is planned, but right now you need to seek it elsewhere.
</p>

<div id="content">

<p class="box-title-red">Note:</p>
<p class="box-red" style="margin-bottom: 25px;">
These functions are defined by Skript. You may also create your own functions!
Tutorial for doing so is planned, but right now you need to seek it elsewhere.
</p>

${generate functions desc_full.html}
</div>
47 changes: 21 additions & 26 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
<h1 id="nav-title">Documentation</h1>

<div id="content">
<p>
Skript is (surprise, surprise) a scripting plugin for Bukkit platform. It
is easy to use for simple tasks, but yet you can create really complex things
with it. The syntax of Skript is close to English, but it is still not magic.
While for simple tasks you might succeed with experimentation, for anything
more complex you will need some guidance.
</p>
<div id="content" class="no-left-panel" style="margin-top: 40px;">
<p>
<b>Skript</b> is (surprise, surprise) a scripting plugin for the Bukkit platform. It is easy to use for simple tasks, but you can also create really complex things with it. The syntax of Skript is close to English, but it is still not magic. While you might succeed with experimentation for simple tasks, for anything more complex you will need some guidance.
AyhamAl-Ali marked this conversation as resolved.
Show resolved Hide resolved
</p>

<p>
This is the Skript documentation. You will find all supported features of Skript
plugin here. You might also find some useful examples, in case you need more
than what was shipped with Skript distribution. We do not currently have
tutorials here, but you can find good ones using whatever search engine you prefer.
</p>
<p>
This is Skript's documentation. You will find all supported features of the plugin here, along with some useful examples. We don't have tutorials yet, but you can find good ones using whatever search engine you prefer.
</p>

<p class="box">
Found something incorrect in this documentation? Please report
it to the <a href="https://github.com/SkriptLang/Skript/issues">issue tracker</a>.
</p>
<p class="box">
<strong>We are looking for docs authors!</strong>
Currently, the only documentation is generated automatically. It would be
nice to have some hand-written content such as tutorials on the docs as well. For example, currently we don't have
a tutorial on how to use loops here; This makes it harder for newcomers to learn.
Check <a href="https://github.com/SkriptLang/Skript/issues/611">this issue</a> for
more details and if you're interested in helping out.
</p>
<p class="box">
Found something incorrect in this documentation? Please report it to the
<a href="https://github.com/SkriptLang/Skript/issues">issue tracker</a>.
</p>
<p class="box">
<strong>We are looking for docs authors!</strong>
Currently, the only documentation is generated automatically. It would be
nice to have some hand-written content such as tutorials on the docs as
well. For example, currently we don't have a tutorial on how to use loops
here; This makes it harder for newcomers to learn. Check
<a href="https://github.com/SkriptLang/Skript/issues/611">this issue</a> for
more details and if you're interested in helping out.
</p>
<p style="font-size: 14px;">Skript • <a href="https://github.com/bensku/Skript/">SkriptLang Team</a> • Styling by <a href="https://github.com/AyhamAl-Ali">Ayham Al-Ali</a> | 2021</p>
AyhamAl-Ali marked this conversation as resolved.
Show resolved Hide resolved
</div>
37 changes: 37 additions & 0 deletions docs/js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// ID Scroll
const links = document.querySelectorAll("div.item-warpper");
const contents = document.querySelectorAll("#content")[0];

lastActive = null;

contents.addEventListener('scroll', (e) => {
links.forEach((ha) => {
const rect = ha.getBoundingClientRect();
if (rect.top > 0 && rect.top < 150) {
const location = window.location.toString().split("#")[0];
history.replaceState(null, null, location + "#" + ha.id);

if (lastActive != null) {
lastActive.classList.remove("active-item");
}

lastActive = document.querySelectorAll(`#nav-contents a[href="#${ha.id}"]`)[0];
if (lastActive != null) {
lastActive.classList.add("active-item");
}
}
});
});


// Active Tab
const pageLink = window.location.toString().replaceAll(/(.*)\/(.+?).html(.*)/gi, '$2');
document.querySelectorAll(`#global-navigation a[href="${pageLink}.html"]`)[0].classList.add("active-tab");


// No Left Panel
const noLeftPanel = document.querySelectorAll('#content.no-left-panel')[0];
if (noLeftPanel != null) {
document.querySelectorAll('#side-nav')[0].classList.add('no-left-panel');
}

15 changes: 15 additions & 0 deletions docs/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,20 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=0.8, maximum-scale=1.0">

<meta name="description" content="Skript is a Bukkit plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them. - SkriptLang/Skript">

<link rel="icon" type="image/png" href="./assets/icon.png">

<title>Skript Documentation - ${skript.version}</title>
<link href="css/styles.css" rel="stylesheet">

<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,900;1,200;1,300;1,400;1,500;1,600;1,700;1,900&display=swap" rel="stylesheet">

<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">

</head>
<body>
${include navbar.html}
Expand All @@ -13,6 +25,9 @@
${generate ${pagename} desc_nav.html}
</div>
</nav>

${content}

<script src="./js/main.js"></script>
</body>
</html>
86 changes: 41 additions & 45 deletions docs/templates/desc_full.html
Original file line number Diff line number Diff line change
@@ -1,51 +1,47 @@
<div class="item-title" id="${element.id}">
${element.name}
<a href="#${element.id}">&#128279;</a>
</div>
<div class="item-content">
<table>

<tr class="item-details">
<td class="item-table-label">Patterns:</td>
<td class="noleftpad">
<ul>
${generate element.patterns pattern_element.html}
</ul>
</td>
</tr>

<tr class="item-details">
<td class="item-table-label">Since:</td>
<td>${element.since}</td>
</tr>

${if events}
<tr class="item-details">
<td class="item-table-label">Usable in events:</td>
<td>${element.events}</td>
</tr>
${end}

${if required-plugins}
<tr class="item-details">
<td class="item-table-label">Requirements:</td>
<td>${element.required-plugins}</td>
</tr>
${end}

</table>

<div class="item-description">
${element.desc}
<div class="item-warpper" id="${element.id}">
<div class="item-title">
<h1 style="display: inline-block">${element.name}</h1> <a href="#${element.id}">&#128279;</a>
</div>
<div class="item-content">
<table>
<tr class="item-details">
<td class="item-table-label">Patterns:</td>
<td class="noleftpad">
<ul>
${generate element.patterns pattern_element.html}
</ul>
</td>
</tr>

<tr class="item-details">
<td class="item-table-label">Since:</td>
<td>${element.since}</td>
</tr>

${if events}
<tr class="item-details">
<td class="item-table-label">Usable in events:</td>
<td>${element.events}</td>
</tr>

${end} ${if required-plugins}
<tr class="item-details">
<td class="item-table-label">Requirements:</td>
<td>${element.required-plugins}</td>
</tr>
${end}
</table>

<div class="item-description">
${element.desc}
</div>

<div class="item-examples">

Examples:
<div class="item-examples">
<p>Examples:</p>

<div class="skript-code-block">
${element.examples}
<div class="skript-code-block">
${element.examples}
</div>
</div>

</div>
</div>
23 changes: 13 additions & 10 deletions docs/templates/navbar.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<nav id="global-navigation">
<a href="index.html">Home</a>
<a href="events.html">Events</a>
<a href="conditions.html">Conditions</a>
<a href="effects.html">Effects</a>
<a href="expressions.html">Expressions</a>
<a href="classes.html">Types</a>
<a href="text.html">Text</a>
<a href="functions.html">Functions</a>
</nav>
<ul id="global-navigation">
<li><a href="index.html">Home</a></li>
<li><a href="events.html">Events</a></li>
<li><a href="conditions.html">Conditions</a></li>
<li><a href="effects.html">Effects</a></li>
<li><a href="expressions.html">Expressions</a></li>
<li><a href="classes.html">Types</a></li>
<li><a href="text.html">Text</a></li>
<li><a href="functions.html">Functions</a></li>
<li><a href="tutorials.html">Tutorials</a></li>
<li><a href="https://github.com/SkriptLang/Skript/" target="_blank" style="font-weight: bold;">GitHub</a></li>
<li style="font-weight: bold; color: #ff9800; float: right;">v${skript.version}</li>
</ul>
Loading