diff --git a/__main__.py b/__main__.py index e8fd198..811a4ed 100644 --- a/__main__.py +++ b/__main__.py @@ -66,13 +66,16 @@ for root, subdirs, files in os.walk(src): smallstring = small.strip() whitespace = small[len(smallstring):] rawmarkdown = rawmarkdown.replace(small, ""+smallstring+"\n"+whitespace) - converted = mark.convert(rawmarkdown) - links = re.findall(r'\[\[.+\]\]', converted) + links = re.findall(r'\[\[.+\]\]', rawmarkdown) for link in links: - converted = converted.replace(link, ""+link[2:-2].split("/")[-1]+"") - links = re.findall(r'\[.+\]\[.+\]',converted) + rawmarkdown = rawmarkdown.replace(link, ""+link[2:-2].split("/")[-1]+"") + links = re.findall(r'\[.+\]\[.+\]',rawmarkdown) for link in links: name = link[1:].split("]",1)[0] href = link[1:].split("[",1)[1].split("]",1)[0] - converted = converted.replace(link, ""+name+"") + if(href.startswith("http://") or href.startswith("https://")): + rawmarkdown = rawmarkdown.replace(link, ""+name+"") + else: + rawmarkdown = rawmarkdown.replace(link, ""+name+"") + converted = mark.convert(rawmarkdown) r.write(template.replace("@CONTENT",converted).replace("@FILETREE",filetree)) \ No newline at end of file diff --git a/dst/QScript/Introduction.html b/dst/QScript/Introduction.html index 35debe6..6fd2ce6 100644 --- a/dst/QScript/Introduction.html +++ b/dst/QScript/Introduction.html @@ -1,8 +1,8 @@ SourceBox Wiki + +
+ + +
+
+

+

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 | +Go back to the QScript Tutorial

+ +
\ No newline at end of file diff --git a/dst/QScript/Squirrel/Intro.html b/dst/QScript/Squirrel/Intro.html new file mode 100644 index 0000000..bcba2ab --- /dev/null +++ b/dst/QScript/Squirrel/Intro.html @@ -0,0 +1,156 @@ + +SourceBox Wiki + + +
+ + +
+
+

+

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

+ +

If you know what you need, continue to the next page.

+ +
+ +

Next ->

+ +
\ No newline at end of file diff --git a/dst/QScript/Tutorial/Chapter1.html b/dst/QScript/Tutorial/Chapter1.html index a8cff6d..d762916 100644 --- a/dst/QScript/Tutorial/Chapter1.html +++ b/dst/QScript/Tutorial/Chapter1.html @@ -1,8 +1,8 @@ SourceBox Wiki + +
+ + +
+
+

+

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:

+ + + +
+ +

<- Prev

+ +
\ No newline at end of file diff --git a/dst/index.html b/dst/index.html index 74ed953..c13b78e 100644 --- a/dst/index.html +++ b/dst/index.html @@ -1,8 +1,8 @@ SourceBox Wiki