mirror of
https://github.com/celisej567/wiki.git
synced 2026-01-06 10:09:54 +03:00
More documentation
This commit is contained in:
13
__main__.py
13
__main__.py
@@ -66,13 +66,16 @@ for root, subdirs, files in os.walk(src):
|
|||||||
smallstring = small.strip()
|
smallstring = small.strip()
|
||||||
whitespace = small[len(smallstring):]
|
whitespace = small[len(smallstring):]
|
||||||
rawmarkdown = rawmarkdown.replace(small, "<small style=\"position:relative; top:16px;\">"+smallstring+"</small>\n"+whitespace)
|
rawmarkdown = rawmarkdown.replace(small, "<small style=\"position:relative; top:16px;\">"+smallstring+"</small>\n"+whitespace)
|
||||||
converted = mark.convert(rawmarkdown)
|
links = re.findall(r'\[\[.+\]\]', rawmarkdown)
|
||||||
links = re.findall(r'\[\[.+\]\]', converted)
|
|
||||||
for link in links:
|
for link in links:
|
||||||
converted = converted.replace(link, "<a href=\"/wiki/"+link[2:-2]+".html\">"+link[2:-2].split("/")[-1]+"</a>")
|
rawmarkdown = rawmarkdown.replace(link, "<a href=\"/wiki/"+link[2:-2]+".html\">"+link[2:-2].split("/")[-1]+"</a>")
|
||||||
links = re.findall(r'\[.+\]\[.+\]',converted)
|
links = re.findall(r'\[.+\]\[.+\]',rawmarkdown)
|
||||||
for link in links:
|
for link in links:
|
||||||
name = link[1:].split("]",1)[0]
|
name = link[1:].split("]",1)[0]
|
||||||
href = link[1:].split("[",1)[1].split("]",1)[0]
|
href = link[1:].split("[",1)[1].split("]",1)[0]
|
||||||
converted = converted.replace(link, "<a href=\"/wiki/"+href+".html\">"+name+"</a>")
|
if(href.startswith("http://") or href.startswith("https://")):
|
||||||
|
rawmarkdown = rawmarkdown.replace(link, "<a href=\""+href+"\">"+name+"</a>")
|
||||||
|
else:
|
||||||
|
rawmarkdown = rawmarkdown.replace(link, "<a href=\"/wiki/"+href+".html\">"+name+"</a>")
|
||||||
|
converted = mark.convert(rawmarkdown)
|
||||||
r.write(template.replace("@CONTENT",converted).replace("@FILETREE",filetree))
|
r.write(template.replace("@CONTENT",converted).replace("@FILETREE",filetree))
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<title>SourceBox Wiki</title>
|
<title>SourceBox Wiki</title>
|
||||||
<script>
|
<script>
|
||||||
documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Intro.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Tutorial/Chapter1.html'];
|
documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Intro.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Squirrel/Exports_And_Imports.html', '/wiki/QScript/Squirrel/Intro.html', '/wiki/QScript/Tutorial/Chapter1.html', '/wiki/QScript/Tutorial/Chapter2.html'];
|
||||||
namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Intro', 'Lua Objects', 'QScript Tutorial Chapter 1'];
|
namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Intro', 'Lua Objects', 'Squirrel Exports and Imports', 'Squirrel Intro', 'QScript Tutorial Page 1: Mods', 'QScript Tutorial Page 2: Getting to work'];
|
||||||
|
|
||||||
function toggleTree(element)
|
function toggleTree(element)
|
||||||
{
|
{
|
||||||
@@ -125,11 +125,14 @@ li b {
|
|||||||
</li>
|
</li>
|
||||||
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Squirrel</b>
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Squirrel</b>
|
||||||
<ul class="nested">
|
<ul class="nested">
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Exports_And_Imports.html">Squirrel Exports and Imports</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Intro.html">Squirrel Intro</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Tutorial</b>
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Tutorial</b>
|
||||||
<ul class="nested">
|
<ul class="nested">
|
||||||
<li><a href="/wiki/QScript/Tutorial/Chapter1.html">QScript Tutorial Chapter 1</a></li>
|
<li><a href="/wiki/QScript/Tutorial/Chapter1.html">QScript Tutorial Page 1: Mods</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Tutorial/Chapter2.html">QScript Tutorial Page 2: Getting to work</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<title>SourceBox Wiki</title>
|
<title>SourceBox Wiki</title>
|
||||||
<script>
|
<script>
|
||||||
documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Intro.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Tutorial/Chapter1.html'];
|
documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Intro.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Squirrel/Exports_And_Imports.html', '/wiki/QScript/Squirrel/Intro.html', '/wiki/QScript/Tutorial/Chapter1.html', '/wiki/QScript/Tutorial/Chapter2.html'];
|
||||||
namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Intro', 'Lua Objects', 'QScript Tutorial Chapter 1'];
|
namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Intro', 'Lua Objects', 'Squirrel Exports and Imports', 'Squirrel Intro', 'QScript Tutorial Page 1: Mods', 'QScript Tutorial Page 2: Getting to work'];
|
||||||
|
|
||||||
function toggleTree(element)
|
function toggleTree(element)
|
||||||
{
|
{
|
||||||
@@ -125,11 +125,14 @@ li b {
|
|||||||
</li>
|
</li>
|
||||||
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Squirrel</b>
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Squirrel</b>
|
||||||
<ul class="nested">
|
<ul class="nested">
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Exports_And_Imports.html">Squirrel Exports and Imports</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Intro.html">Squirrel Intro</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Tutorial</b>
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Tutorial</b>
|
||||||
<ul class="nested">
|
<ul class="nested">
|
||||||
<li><a href="/wiki/QScript/Tutorial/Chapter1.html">QScript Tutorial Chapter 1</a></li>
|
<li><a href="/wiki/QScript/Tutorial/Chapter1.html">QScript Tutorial Page 1: Mods</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Tutorial/Chapter2.html">QScript Tutorial Page 2: Getting to work</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -186,6 +189,7 @@ finish(another_class) -- Finishes it
|
|||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<p><a href="/wiki/QScript/Lua/Objects.html">Next -></a></p>
|
<p><a href="/wiki/QScript/Lua/Intro.html"><- Prev</a> |
|
||||||
|
<a href="/wiki/QScript/Lua/Objects.html">Next -></a></p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<title>SourceBox Wiki</title>
|
<title>SourceBox Wiki</title>
|
||||||
<script>
|
<script>
|
||||||
documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Intro.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Tutorial/Chapter1.html'];
|
documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Intro.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Squirrel/Exports_And_Imports.html', '/wiki/QScript/Squirrel/Intro.html', '/wiki/QScript/Tutorial/Chapter1.html', '/wiki/QScript/Tutorial/Chapter2.html'];
|
||||||
namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Intro', 'Lua Objects', 'QScript Tutorial Chapter 1'];
|
namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Intro', 'Lua Objects', 'Squirrel Exports and Imports', 'Squirrel Intro', 'QScript Tutorial Page 1: Mods', 'QScript Tutorial Page 2: Getting to work'];
|
||||||
|
|
||||||
function toggleTree(element)
|
function toggleTree(element)
|
||||||
{
|
{
|
||||||
@@ -125,11 +125,14 @@ li b {
|
|||||||
</li>
|
</li>
|
||||||
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Squirrel</b>
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Squirrel</b>
|
||||||
<ul class="nested">
|
<ul class="nested">
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Exports_And_Imports.html">Squirrel Exports and Imports</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Intro.html">Squirrel Intro</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Tutorial</b>
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Tutorial</b>
|
||||||
<ul class="nested">
|
<ul class="nested">
|
||||||
<li><a href="/wiki/QScript/Tutorial/Chapter1.html">QScript Tutorial Chapter 1</a></li>
|
<li><a href="/wiki/QScript/Tutorial/Chapter1.html">QScript Tutorial Page 1: Mods</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Tutorial/Chapter2.html">QScript Tutorial Page 2: Getting to work</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<title>SourceBox Wiki</title>
|
<title>SourceBox Wiki</title>
|
||||||
<script>
|
<script>
|
||||||
documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Intro.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Tutorial/Chapter1.html'];
|
documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Intro.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Squirrel/Exports_And_Imports.html', '/wiki/QScript/Squirrel/Intro.html', '/wiki/QScript/Tutorial/Chapter1.html', '/wiki/QScript/Tutorial/Chapter2.html'];
|
||||||
namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Intro', 'Lua Objects', 'QScript Tutorial Chapter 1'];
|
namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Intro', 'Lua Objects', 'Squirrel Exports and Imports', 'Squirrel Intro', 'QScript Tutorial Page 1: Mods', 'QScript Tutorial Page 2: Getting to work'];
|
||||||
|
|
||||||
function toggleTree(element)
|
function toggleTree(element)
|
||||||
{
|
{
|
||||||
@@ -125,11 +125,14 @@ li b {
|
|||||||
</li>
|
</li>
|
||||||
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Squirrel</b>
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Squirrel</b>
|
||||||
<ul class="nested">
|
<ul class="nested">
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Exports_And_Imports.html">Squirrel Exports and Imports</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Intro.html">Squirrel Intro</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Tutorial</b>
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Tutorial</b>
|
||||||
<ul class="nested">
|
<ul class="nested">
|
||||||
<li><a href="/wiki/QScript/Tutorial/Chapter1.html">QScript Tutorial Chapter 1</a></li>
|
<li><a href="/wiki/QScript/Tutorial/Chapter1.html">QScript Tutorial Page 1: Mods</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Tutorial/Chapter2.html">QScript Tutorial Page 2: Getting to work</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -168,6 +171,7 @@ MyLib.add(5,7) -- Will return 12
|
|||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<p><a href="/wiki/QScript/Lua/Exports.html"><- Prev</a></p>
|
<p><a href="/wiki/QScript/Lua/Exports.html"><- Prev</a> |
|
||||||
|
<a href="/wiki/QScript/Tutorial/Chapter1.html">Go back to the QScript Tutorial</a></p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<title>SourceBox Wiki</title>
|
<title>SourceBox Wiki</title>
|
||||||
<script>
|
<script>
|
||||||
documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Intro.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Tutorial/Chapter1.html'];
|
documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Intro.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Squirrel/Exports_And_Imports.html', '/wiki/QScript/Squirrel/Intro.html', '/wiki/QScript/Tutorial/Chapter1.html', '/wiki/QScript/Tutorial/Chapter2.html'];
|
||||||
namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Intro', 'Lua Objects', 'QScript Tutorial Chapter 1'];
|
namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Intro', 'Lua Objects', 'Squirrel Exports and Imports', 'Squirrel Intro', 'QScript Tutorial Page 1: Mods', 'QScript Tutorial Page 2: Getting to work'];
|
||||||
|
|
||||||
function toggleTree(element)
|
function toggleTree(element)
|
||||||
{
|
{
|
||||||
@@ -125,11 +125,14 @@ li b {
|
|||||||
</li>
|
</li>
|
||||||
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Squirrel</b>
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Squirrel</b>
|
||||||
<ul class="nested">
|
<ul class="nested">
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Exports_And_Imports.html">Squirrel Exports and Imports</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Intro.html">Squirrel Intro</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Tutorial</b>
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Tutorial</b>
|
||||||
<ul class="nested">
|
<ul class="nested">
|
||||||
<li><a href="/wiki/QScript/Tutorial/Chapter1.html">QScript Tutorial Chapter 1</a></li>
|
<li><a href="/wiki/QScript/Tutorial/Chapter1.html">QScript Tutorial Page 1: Mods</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Tutorial/Chapter2.html">QScript Tutorial Page 2: Getting to work</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<title>SourceBox Wiki</title>
|
<title>SourceBox Wiki</title>
|
||||||
<script>
|
<script>
|
||||||
documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Intro.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Tutorial/Chapter1.html'];
|
documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Intro.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Squirrel/Exports_And_Imports.html', '/wiki/QScript/Squirrel/Intro.html', '/wiki/QScript/Tutorial/Chapter1.html', '/wiki/QScript/Tutorial/Chapter2.html'];
|
||||||
namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Intro', 'Lua Objects', 'QScript Tutorial Chapter 1'];
|
namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Intro', 'Lua Objects', 'Squirrel Exports and Imports', 'Squirrel Intro', 'QScript Tutorial Page 1: Mods', 'QScript Tutorial Page 2: Getting to work'];
|
||||||
|
|
||||||
function toggleTree(element)
|
function toggleTree(element)
|
||||||
{
|
{
|
||||||
@@ -125,11 +125,14 @@ li b {
|
|||||||
</li>
|
</li>
|
||||||
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Squirrel</b>
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Squirrel</b>
|
||||||
<ul class="nested">
|
<ul class="nested">
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Exports_And_Imports.html">Squirrel Exports and Imports</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Intro.html">Squirrel Intro</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Tutorial</b>
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Tutorial</b>
|
||||||
<ul class="nested">
|
<ul class="nested">
|
||||||
<li><a href="/wiki/QScript/Tutorial/Chapter1.html">QScript Tutorial Chapter 1</a></li>
|
<li><a href="/wiki/QScript/Tutorial/Chapter1.html">QScript Tutorial Page 1: Mods</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Tutorial/Chapter2.html">QScript Tutorial Page 2: Getting to work</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
184
dst/QScript/Squirrel/Exports_And_Imports.html
Normal file
184
dst/QScript/Squirrel/Exports_And_Imports.html
Normal file
@@ -0,0 +1,184 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<title>SourceBox Wiki</title>
|
||||||
|
<script>
|
||||||
|
documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Intro.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Squirrel/Exports_And_Imports.html', '/wiki/QScript/Squirrel/Intro.html', '/wiki/QScript/Tutorial/Chapter1.html', '/wiki/QScript/Tutorial/Chapter2.html'];
|
||||||
|
namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Intro', 'Lua Objects', 'Squirrel Exports and Imports', 'Squirrel Intro', 'QScript Tutorial Page 1: Mods', 'QScript Tutorial Page 2: Getting to work'];
|
||||||
|
|
||||||
|
function toggleTree(element)
|
||||||
|
{
|
||||||
|
nested = element.parentNode.childNodes[3];
|
||||||
|
if(nested.className.indexOf("active",0) != -1)
|
||||||
|
{
|
||||||
|
nested.className = "nested";
|
||||||
|
element.parentNode.childNodes[0].innerHTML = "+";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nested.className = "nested active";
|
||||||
|
element.parentNode.childNodes[0].innerHTML = "-";
|
||||||
|
}
|
||||||
|
if(element.className.indexOf("active",0) != -1)
|
||||||
|
{
|
||||||
|
element.className = ""
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
element.className = "active"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateSearch() {
|
||||||
|
searchtext = document.getElementById("searchbox").value.toLowerCase();
|
||||||
|
var res = [];
|
||||||
|
var searchresults = document.getElementById("searchresults")
|
||||||
|
searchresults.innerHTML = ""
|
||||||
|
if(searchtext === "")
|
||||||
|
{
|
||||||
|
document.getElementById("filetree").style.display = "block"
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
document.getElementById("filetree").style.display = "none"
|
||||||
|
}
|
||||||
|
for (var i = 0; i < namelist.length; i++)
|
||||||
|
{
|
||||||
|
if(namelist[i].toLowerCase().indexOf(searchtext) == -1) continue;
|
||||||
|
var searchelement = document.createElement("li");
|
||||||
|
var link = document.createElement("a");
|
||||||
|
searchelement.appendChild(link);
|
||||||
|
link.setAttribute("href", documentlist[i]);
|
||||||
|
link.innerHTML = namelist[i];
|
||||||
|
searchresults.appendChild(searchelement);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
pre {
|
||||||
|
margin-left:16px;
|
||||||
|
background-color: #EEE;
|
||||||
|
border-color: #CCC;
|
||||||
|
border-style:solid;
|
||||||
|
border-width:1px;
|
||||||
|
}
|
||||||
|
.nested {
|
||||||
|
display: none;
|
||||||
|
border-left: 1px solid #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.active {
|
||||||
|
display: block !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
padding-left: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
li ::marker {
|
||||||
|
color:#00000000;
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
list-style-type: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
li b {
|
||||||
|
cursor: pointer;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.liicon {
|
||||||
|
display:inline-block;
|
||||||
|
width:12px;
|
||||||
|
height:100%;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<div style="position:fixed; display:block; top: 0px; left: 0px; height:100%; width:200px;border-color: black; border-width: 1px; border-style:solid;">
|
||||||
|
<input type="text" placeholder="search..." autocomplete="off" id="searchbox" oninput="updateSearch();" style="width:192px;">
|
||||||
|
<nav>
|
||||||
|
<ul id="searchresults">
|
||||||
|
</ul>
|
||||||
|
<ul id="filetree">
|
||||||
|
<li><a href="/wiki/index.html">Wiki Intro</a></li>
|
||||||
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">QScript</b>
|
||||||
|
<ul class="nested">
|
||||||
|
<li><a href="/wiki/QScript/Introduction.html">QScript Intro</a></li>
|
||||||
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Lua</b>
|
||||||
|
<ul class="nested">
|
||||||
|
<li><a href="/wiki/QScript/Lua/Classes.html">Lua Classes</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Lua/Exports.html">Lua Exports</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Lua/Imports.html">Lua Imports</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Lua/Intro.html">Lua Intro</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Lua/Objects.html">Lua Objects</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Python</b>
|
||||||
|
<ul class="nested">
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Squirrel</b>
|
||||||
|
<ul class="nested">
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Exports_And_Imports.html">Squirrel Exports and Imports</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Intro.html">Squirrel Intro</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Tutorial</b>
|
||||||
|
<ul class="nested">
|
||||||
|
<li><a href="/wiki/QScript/Tutorial/Chapter1.html">QScript Tutorial Page 1: Mods</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Tutorial/Chapter2.html">QScript Tutorial Page 2: Getting to work</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
<div style="margin-left:200px;">
|
||||||
|
<p id="errorp"></p>
|
||||||
|
<h1>Squirrel Exports and Imports</h1>
|
||||||
|
|
||||||
|
<p>The main big feature of QScript is the export system. It lets you export classes, objects and functions which other files can import from your script.</p>
|
||||||
|
|
||||||
|
<p>Let's say that you have a library called "MyLib.nut" inside a mod called "MyMod". This is what it contains:</p>
|
||||||
|
|
||||||
|
<p><small style="position:relative; top:16px;">MyMod/MyLib.nut</small></p>
|
||||||
|
|
||||||
|
<pre><code>class AdditionClass
|
||||||
|
{
|
||||||
|
function Add(a,b)
|
||||||
|
{
|
||||||
|
return a + b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Addition <- AdditionClass() -- Exports can only use global variables!
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Now to export the <code>Addition</code> object, pass them to the <code>export()</code> function at the end of the file.</p>
|
||||||
|
|
||||||
|
<p><small style="position:relative; top:16px;">MyMod/MyLib.nut</small></p>
|
||||||
|
|
||||||
|
<pre><code>export(Addition);
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>To import the exported elements in another file, simply use the <code>import()</code> function with the file path of the script you want to import from.</p>
|
||||||
|
|
||||||
|
<pre><code>MyLib <- import("MyMod/MyLib.nut");
|
||||||
|
|
||||||
|
MyLib.Addition.Add(2,5); -- will return 7
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<p><a href="/wiki/QScript/Squirrel/Intro.html"><- Prev</a> |
|
||||||
|
<a href="/wiki/QScript/Tutorial/Chapter1.html">Go back to the QScript Tutorial</a></p>
|
||||||
|
|
||||||
|
</div>
|
||||||
156
dst/QScript/Squirrel/Intro.html
Normal file
156
dst/QScript/Squirrel/Intro.html
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<title>SourceBox Wiki</title>
|
||||||
|
<script>
|
||||||
|
documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Intro.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Squirrel/Exports_And_Imports.html', '/wiki/QScript/Squirrel/Intro.html', '/wiki/QScript/Tutorial/Chapter1.html', '/wiki/QScript/Tutorial/Chapter2.html'];
|
||||||
|
namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Intro', 'Lua Objects', 'Squirrel Exports and Imports', 'Squirrel Intro', 'QScript Tutorial Page 1: Mods', 'QScript Tutorial Page 2: Getting to work'];
|
||||||
|
|
||||||
|
function toggleTree(element)
|
||||||
|
{
|
||||||
|
nested = element.parentNode.childNodes[3];
|
||||||
|
if(nested.className.indexOf("active",0) != -1)
|
||||||
|
{
|
||||||
|
nested.className = "nested";
|
||||||
|
element.parentNode.childNodes[0].innerHTML = "+";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nested.className = "nested active";
|
||||||
|
element.parentNode.childNodes[0].innerHTML = "-";
|
||||||
|
}
|
||||||
|
if(element.className.indexOf("active",0) != -1)
|
||||||
|
{
|
||||||
|
element.className = ""
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
element.className = "active"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateSearch() {
|
||||||
|
searchtext = document.getElementById("searchbox").value.toLowerCase();
|
||||||
|
var res = [];
|
||||||
|
var searchresults = document.getElementById("searchresults")
|
||||||
|
searchresults.innerHTML = ""
|
||||||
|
if(searchtext === "")
|
||||||
|
{
|
||||||
|
document.getElementById("filetree").style.display = "block"
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
document.getElementById("filetree").style.display = "none"
|
||||||
|
}
|
||||||
|
for (var i = 0; i < namelist.length; i++)
|
||||||
|
{
|
||||||
|
if(namelist[i].toLowerCase().indexOf(searchtext) == -1) continue;
|
||||||
|
var searchelement = document.createElement("li");
|
||||||
|
var link = document.createElement("a");
|
||||||
|
searchelement.appendChild(link);
|
||||||
|
link.setAttribute("href", documentlist[i]);
|
||||||
|
link.innerHTML = namelist[i];
|
||||||
|
searchresults.appendChild(searchelement);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
pre {
|
||||||
|
margin-left:16px;
|
||||||
|
background-color: #EEE;
|
||||||
|
border-color: #CCC;
|
||||||
|
border-style:solid;
|
||||||
|
border-width:1px;
|
||||||
|
}
|
||||||
|
.nested {
|
||||||
|
display: none;
|
||||||
|
border-left: 1px solid #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.active {
|
||||||
|
display: block !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
padding-left: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
li ::marker {
|
||||||
|
color:#00000000;
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
list-style-type: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
li b {
|
||||||
|
cursor: pointer;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.liicon {
|
||||||
|
display:inline-block;
|
||||||
|
width:12px;
|
||||||
|
height:100%;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<div style="position:fixed; display:block; top: 0px; left: 0px; height:100%; width:200px;border-color: black; border-width: 1px; border-style:solid;">
|
||||||
|
<input type="text" placeholder="search..." autocomplete="off" id="searchbox" oninput="updateSearch();" style="width:192px;">
|
||||||
|
<nav>
|
||||||
|
<ul id="searchresults">
|
||||||
|
</ul>
|
||||||
|
<ul id="filetree">
|
||||||
|
<li><a href="/wiki/index.html">Wiki Intro</a></li>
|
||||||
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">QScript</b>
|
||||||
|
<ul class="nested">
|
||||||
|
<li><a href="/wiki/QScript/Introduction.html">QScript Intro</a></li>
|
||||||
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Lua</b>
|
||||||
|
<ul class="nested">
|
||||||
|
<li><a href="/wiki/QScript/Lua/Classes.html">Lua Classes</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Lua/Exports.html">Lua Exports</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Lua/Imports.html">Lua Imports</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Lua/Intro.html">Lua Intro</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Lua/Objects.html">Lua Objects</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Python</b>
|
||||||
|
<ul class="nested">
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Squirrel</b>
|
||||||
|
<ul class="nested">
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Exports_And_Imports.html">Squirrel Exports and Imports</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Intro.html">Squirrel Intro</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Tutorial</b>
|
||||||
|
<ul class="nested">
|
||||||
|
<li><a href="/wiki/QScript/Tutorial/Chapter1.html">QScript Tutorial Page 1: Mods</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Tutorial/Chapter2.html">QScript Tutorial Page 2: Getting to work</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
<div style="margin-left:200px;">
|
||||||
|
<p id="errorp"></p>
|
||||||
|
<h1>Squirrel Intro</h1>
|
||||||
|
|
||||||
|
<p>The following pages will assume that you know the basics of Squirrel. If you need a refresher, go to the official documentation linked <a href="https://squirrel-lang.org/squirreldoc/reference/index.html">here</a></p>
|
||||||
|
|
||||||
|
<p>If you know what you need, continue to the next page.</p>
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<p><a href="/wiki/QScript/Squirrel/Exports_And_Imports.html">Next -></a></p>
|
||||||
|
|
||||||
|
</div>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<title>SourceBox Wiki</title>
|
<title>SourceBox Wiki</title>
|
||||||
<script>
|
<script>
|
||||||
documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Intro.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Tutorial/Chapter1.html'];
|
documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Intro.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Squirrel/Exports_And_Imports.html', '/wiki/QScript/Squirrel/Intro.html', '/wiki/QScript/Tutorial/Chapter1.html', '/wiki/QScript/Tutorial/Chapter2.html'];
|
||||||
namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Intro', 'Lua Objects', 'QScript Tutorial Chapter 1'];
|
namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Intro', 'Lua Objects', 'Squirrel Exports and Imports', 'Squirrel Intro', 'QScript Tutorial Page 1: Mods', 'QScript Tutorial Page 2: Getting to work'];
|
||||||
|
|
||||||
function toggleTree(element)
|
function toggleTree(element)
|
||||||
{
|
{
|
||||||
@@ -125,11 +125,14 @@ li b {
|
|||||||
</li>
|
</li>
|
||||||
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Squirrel</b>
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Squirrel</b>
|
||||||
<ul class="nested">
|
<ul class="nested">
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Exports_And_Imports.html">Squirrel Exports and Imports</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Intro.html">Squirrel Intro</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Tutorial</b>
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Tutorial</b>
|
||||||
<ul class="nested">
|
<ul class="nested">
|
||||||
<li><a href="/wiki/QScript/Tutorial/Chapter1.html">QScript Tutorial Chapter 1</a></li>
|
<li><a href="/wiki/QScript/Tutorial/Chapter1.html">QScript Tutorial Page 1: Mods</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Tutorial/Chapter2.html">QScript Tutorial Page 2: Getting to work</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -140,16 +143,28 @@ li b {
|
|||||||
</div>
|
</div>
|
||||||
<div style="margin-left:200px;">
|
<div style="margin-left:200px;">
|
||||||
<p id="errorp"></p>
|
<p id="errorp"></p>
|
||||||
<h1>QScript Tutorial Chapter 1</h1>
|
<h1>QScript Tutorial Page 1: Mods</h1>
|
||||||
|
|
||||||
<p>Currently, only a short documentation of Lua is available. </p>
|
<p>QScript operates on "mods" which are folders inside the <code>sourcebox/mods/</code> directory.</p>
|
||||||
|
|
||||||
<p>Languages:</p>
|
<p>Make a new directory called "TutorialMod" inside it. This will be the mod you will be operating on in the tutorial.</p>
|
||||||
|
|
||||||
|
<p>Before you can begin coding anything, you have to pick a language.</p>
|
||||||
|
|
||||||
|
<p>QScript currently supports the following lanugages:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p><a href="/wiki/QScript/Lua/Intro.html">Lua</a></p></li>
|
<li><p><a href="/wiki/QScript/Lua/Intro.html">Lua</a></p></li>
|
||||||
<li><p>Squirrel</p></li>
|
<li><p><a href="/wiki/QScript/Squirrel/Intro.html">Squirrel</a></p></li>
|
||||||
<li><p>Python</p></li>
|
<li><p>Python</p></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<p>Go to the language you will be using to learn about the QScript specific changes for each language.</p>
|
||||||
|
|
||||||
|
<p>After you learned what you need to know, go to the next page.</p>
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<p><a href="/wiki/QScript/Tutorial/Chapter2.html">Next -></a></p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
161
dst/QScript/Tutorial/Chapter2.html
Normal file
161
dst/QScript/Tutorial/Chapter2.html
Normal file
@@ -0,0 +1,161 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<title>SourceBox Wiki</title>
|
||||||
|
<script>
|
||||||
|
documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Intro.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Squirrel/Exports_And_Imports.html', '/wiki/QScript/Squirrel/Intro.html', '/wiki/QScript/Tutorial/Chapter1.html', '/wiki/QScript/Tutorial/Chapter2.html'];
|
||||||
|
namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Intro', 'Lua Objects', 'Squirrel Exports and Imports', 'Squirrel Intro', 'QScript Tutorial Page 1: Mods', 'QScript Tutorial Page 2: Getting to work'];
|
||||||
|
|
||||||
|
function toggleTree(element)
|
||||||
|
{
|
||||||
|
nested = element.parentNode.childNodes[3];
|
||||||
|
if(nested.className.indexOf("active",0) != -1)
|
||||||
|
{
|
||||||
|
nested.className = "nested";
|
||||||
|
element.parentNode.childNodes[0].innerHTML = "+";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nested.className = "nested active";
|
||||||
|
element.parentNode.childNodes[0].innerHTML = "-";
|
||||||
|
}
|
||||||
|
if(element.className.indexOf("active",0) != -1)
|
||||||
|
{
|
||||||
|
element.className = ""
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
element.className = "active"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateSearch() {
|
||||||
|
searchtext = document.getElementById("searchbox").value.toLowerCase();
|
||||||
|
var res = [];
|
||||||
|
var searchresults = document.getElementById("searchresults")
|
||||||
|
searchresults.innerHTML = ""
|
||||||
|
if(searchtext === "")
|
||||||
|
{
|
||||||
|
document.getElementById("filetree").style.display = "block"
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
document.getElementById("filetree").style.display = "none"
|
||||||
|
}
|
||||||
|
for (var i = 0; i < namelist.length; i++)
|
||||||
|
{
|
||||||
|
if(namelist[i].toLowerCase().indexOf(searchtext) == -1) continue;
|
||||||
|
var searchelement = document.createElement("li");
|
||||||
|
var link = document.createElement("a");
|
||||||
|
searchelement.appendChild(link);
|
||||||
|
link.setAttribute("href", documentlist[i]);
|
||||||
|
link.innerHTML = namelist[i];
|
||||||
|
searchresults.appendChild(searchelement);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
pre {
|
||||||
|
margin-left:16px;
|
||||||
|
background-color: #EEE;
|
||||||
|
border-color: #CCC;
|
||||||
|
border-style:solid;
|
||||||
|
border-width:1px;
|
||||||
|
}
|
||||||
|
.nested {
|
||||||
|
display: none;
|
||||||
|
border-left: 1px solid #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.active {
|
||||||
|
display: block !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
padding-left: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
li ::marker {
|
||||||
|
color:#00000000;
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
list-style-type: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
li b {
|
||||||
|
cursor: pointer;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.liicon {
|
||||||
|
display:inline-block;
|
||||||
|
width:12px;
|
||||||
|
height:100%;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<div style="position:fixed; display:block; top: 0px; left: 0px; height:100%; width:200px;border-color: black; border-width: 1px; border-style:solid;">
|
||||||
|
<input type="text" placeholder="search..." autocomplete="off" id="searchbox" oninput="updateSearch();" style="width:192px;">
|
||||||
|
<nav>
|
||||||
|
<ul id="searchresults">
|
||||||
|
</ul>
|
||||||
|
<ul id="filetree">
|
||||||
|
<li><a href="/wiki/index.html">Wiki Intro</a></li>
|
||||||
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">QScript</b>
|
||||||
|
<ul class="nested">
|
||||||
|
<li><a href="/wiki/QScript/Introduction.html">QScript Intro</a></li>
|
||||||
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Lua</b>
|
||||||
|
<ul class="nested">
|
||||||
|
<li><a href="/wiki/QScript/Lua/Classes.html">Lua Classes</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Lua/Exports.html">Lua Exports</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Lua/Imports.html">Lua Imports</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Lua/Intro.html">Lua Intro</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Lua/Objects.html">Lua Objects</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Python</b>
|
||||||
|
<ul class="nested">
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Squirrel</b>
|
||||||
|
<ul class="nested">
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Exports_And_Imports.html">Squirrel Exports and Imports</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Intro.html">Squirrel Intro</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Tutorial</b>
|
||||||
|
<ul class="nested">
|
||||||
|
<li><a href="/wiki/QScript/Tutorial/Chapter1.html">QScript Tutorial Page 1: Mods</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Tutorial/Chapter2.html">QScript Tutorial Page 2: Getting to work</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
<div style="margin-left:200px;">
|
||||||
|
<p id="errorp"></p>
|
||||||
|
<h1>QScript Tutorial Page 2: Getting to work</h1>
|
||||||
|
|
||||||
|
<p>In your freshly created folder, make a new file called <code>autorun_client</code> with the extension of your favorite programming language that QScript supports.</p>
|
||||||
|
|
||||||
|
<p>Currently, QScript is in the "DO NOT USE" stage, which means that the only implemented bindings are:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><code>sourcebox_client.Msg()</code> takes a string and prints it to the console.</li>
|
||||||
|
<li><code>sourcebox_client.RegisterCmd()</code> takes a string and a function (in said order) and registers that as a console command.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<p><a href="/wiki/QScript/Tutorial/Chapter1.html"><- Prev</a></p>
|
||||||
|
|
||||||
|
</div>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<title>SourceBox Wiki</title>
|
<title>SourceBox Wiki</title>
|
||||||
<script>
|
<script>
|
||||||
documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Intro.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Tutorial/Chapter1.html'];
|
documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Intro.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Squirrel/Exports_And_Imports.html', '/wiki/QScript/Squirrel/Intro.html', '/wiki/QScript/Tutorial/Chapter1.html', '/wiki/QScript/Tutorial/Chapter2.html'];
|
||||||
namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Intro', 'Lua Objects', 'QScript Tutorial Chapter 1'];
|
namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Intro', 'Lua Objects', 'Squirrel Exports and Imports', 'Squirrel Intro', 'QScript Tutorial Page 1: Mods', 'QScript Tutorial Page 2: Getting to work'];
|
||||||
|
|
||||||
function toggleTree(element)
|
function toggleTree(element)
|
||||||
{
|
{
|
||||||
@@ -125,11 +125,14 @@ li b {
|
|||||||
</li>
|
</li>
|
||||||
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Squirrel</b>
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Squirrel</b>
|
||||||
<ul class="nested">
|
<ul class="nested">
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Exports_And_Imports.html">Squirrel Exports and Imports</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Squirrel/Intro.html">Squirrel Intro</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Tutorial</b>
|
<li><small class="liicon">+</small><b onclick="toggleTree(this);">Tutorial</b>
|
||||||
<ul class="nested">
|
<ul class="nested">
|
||||||
<li><a href="/wiki/QScript/Tutorial/Chapter1.html">QScript Tutorial Chapter 1</a></li>
|
<li><a href="/wiki/QScript/Tutorial/Chapter1.html">QScript Tutorial Page 1: Mods</a></li>
|
||||||
|
<li><a href="/wiki/QScript/Tutorial/Chapter2.html">QScript Tutorial Page 2: Getting to work</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -46,4 +46,5 @@ We can now move on to objects.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
[<- Prev][QScript/Lua/Intro] |
|
||||||
[Next ->][QScript/Lua/Objects]
|
[Next ->][QScript/Lua/Objects]
|
||||||
@@ -24,4 +24,5 @@ The reason why you can't use tables, is because objects, are actually shared! On
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
[<- Prev][QScript/Lua/Exports]
|
[<- Prev][QScript/Lua/Exports] |
|
||||||
|
[Go back to the QScript Tutorial][QScript/Tutorial/Chapter1]
|
||||||
32
src/QScript/Squirrel/Exports_And_Imports.md
Normal file
32
src/QScript/Squirrel/Exports_And_Imports.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# Squirrel Exports and Imports
|
||||||
|
|
||||||
|
The main big feature of QScript is the export system. It lets you export classes, objects and functions which other files can import from your script.
|
||||||
|
|
||||||
|
Let's say that you have a library called "MyLib.nut" inside a mod called "MyMod". This is what it contains:
|
||||||
|
|
||||||
|
MyMod/MyLib.nut
|
||||||
|
class AdditionClass
|
||||||
|
{
|
||||||
|
function Add(a,b)
|
||||||
|
{
|
||||||
|
return a + b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Addition <- AdditionClass() -- Exports can only use global variables!
|
||||||
|
|
||||||
|
Now to export the `Addition` object, pass them to the `export()` function at the end of the file.
|
||||||
|
|
||||||
|
MyMod/MyLib.nut
|
||||||
|
export(Addition);
|
||||||
|
|
||||||
|
To import the exported elements in another file, simply use the `import()` function with the file path of the script you want to import from.
|
||||||
|
|
||||||
|
MyLib <- import("MyMod/MyLib.nut");
|
||||||
|
|
||||||
|
MyLib.Addition.Add(2,5); -- will return 7
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
[<- Prev][QScript/Squirrel/Intro] |
|
||||||
|
[Go back to the QScript Tutorial][QScript/Tutorial/Chapter1]
|
||||||
9
src/QScript/Squirrel/Intro.md
Normal file
9
src/QScript/Squirrel/Intro.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# Squirrel Intro
|
||||||
|
|
||||||
|
The following pages will assume that you know the basics of Squirrel. If you need a refresher, go to the official documentation linked [here][https://squirrel-lang.org/squirreldoc/reference/index.html]
|
||||||
|
|
||||||
|
If you know what you need, continue to the next page.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
[Next ->][QScript/Squirrel/Exports_And_Imports]
|
||||||
@@ -1,11 +1,23 @@
|
|||||||
# QScript Tutorial Chapter 1
|
# QScript Tutorial Page 1: Mods
|
||||||
|
|
||||||
Currently, only a short documentation of Lua is available.
|
QScript operates on "mods" which are folders inside the `sourcebox/mods/` directory.
|
||||||
|
|
||||||
Languages:
|
Make a new directory called "TutorialMod" inside it. This will be the mod you will be operating on in the tutorial.
|
||||||
|
|
||||||
|
Before you can begin coding anything, you have to pick a language.
|
||||||
|
|
||||||
|
QScript currently supports the following lanugages:
|
||||||
|
|
||||||
* [Lua][QScript/Lua/Intro]
|
* [Lua][QScript/Lua/Intro]
|
||||||
|
|
||||||
* Squirrel
|
* [Squirrel][QScript/Squirrel/Intro]
|
||||||
|
|
||||||
* Python
|
* Python
|
||||||
|
|
||||||
|
Go to the language you will be using to learn about the QScript specific changes for each language.
|
||||||
|
|
||||||
|
After you learned what you need to know, go to the next page.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
[Next ->][QScript/Tutorial/Chapter2]
|
||||||
12
src/QScript/Tutorial/Chapter2.md
Normal file
12
src/QScript/Tutorial/Chapter2.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# QScript Tutorial Page 2: Getting to work
|
||||||
|
|
||||||
|
In your freshly created folder, make a new file called `autorun_client` with the extension of your favorite programming language that QScript supports.
|
||||||
|
|
||||||
|
Currently, QScript is in the "DO NOT USE" stage, which means that the only implemented bindings are:
|
||||||
|
|
||||||
|
* `sourcebox_client.Msg()` takes a string and prints it to the console.
|
||||||
|
* `sourcebox_client.RegisterCmd()` takes a string and a function (in said order) and registers that as a console command.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
[<- Prev][QScript/Tutorial/Chapter1]
|
||||||
Reference in New Issue
Block a user