diff --git a/__main__.py b/__main__.py index a9cfed0..e226945 100644 --- a/__main__.py +++ b/__main__.py @@ -4,7 +4,7 @@ import os import re import shutil -mark = markdown2.Markdown() +mark = markdown2.Markdown(extras={"tables":True,"fenced-code-blocks":None,"code-friendly":True,"break-on-newline":True}) rootpath = os.path.dirname(os.path.realpath(__file__)) src = rootpath+"/src/" @@ -78,11 +78,11 @@ for root, subdirs, files in os.walk(src): with open(fpath,"r") as f: with open(dst+fpath[len(src):].replace(".md",".html"), "w") as r: rawmarkdown = f.read().replace("\r\n","\n") - smalls = re.findall(r"^\S+\n[( )\t]",rawmarkdown,re.MULTILINE) + smalls = re.findall(r"^[^\s`]+\n```[\s\S]+?```",rawmarkdown,re.MULTILINE) for small in smalls: - smallstring = small.strip() - whitespace = small[len(smallstring):] - rawmarkdown = rawmarkdown.replace(small, ""+smallstring+"\n"+whitespace) + smallstring = small.split("\n",1)[0] + smallcode = small[len(smallstring):] + rawmarkdown = rawmarkdown.replace(small, ""+smallstring+""+smallcode) links = re.findall(r'\[\[[^\[^\]]+\]\]', rawmarkdown) for link in links: if os.path.exists(os.path.join(src,link[2:-2]+".md")): diff --git a/assets/default.css b/assets/default.css new file mode 100644 index 0000000..e9d2bc4 --- /dev/null +++ b/assets/default.css @@ -0,0 +1,68 @@ +.codehilite .hll { background-color: #ffffcc } +.codehilite .c { color: #0099FF; font-style: italic } /* Comment */ +.codehilite .err { color: #AA0000; background-color: #FFAAAA } /* Error */ +.codehilite .k { color: #006699; font-weight: bold } /* Keyword */ +.codehilite .o { color: #FFAAFF } /* Operator */ +.codehilite .ch { color: #0099FF; font-style: italic } /* Comment.Hashbang */ +.codehilite .cm { color: #0099FF; font-style: italic } /* Comment.Multiline */ +.codehilite .cp { color: #009999 } /* Comment.Preproc */ +.codehilite .cpf { color: #0099FF; font-style: italic } /* Comment.PreprocFile */ +.codehilite .c1 { color: #00AA44; font-style: italic } /* Comment.Single */ +.codehilite .cs { color: #00AA44; font-weight: bold; font-style: italic } /* Comment.Special */ +.codehilite .gd { background-color: #FFCCCC; border: 1px solid #CC0000 } /* Generic.Deleted */ +.codehilite .ge { font-style: italic } /* Generic.Emph */ +.codehilite .gr { color: #FF0000 } /* Generic.Error */ +.codehilite .gh { color: #CCFFCC; font-weight: bold } /* Generic.Heading */ +.codehilite .gi { background-color: #CCFFCC; border: 1px solid #00CC00 } /* Generic.Inserted */ +.codehilite .go { color: #AAAAAA } /* Generic.Output */ +.codehilite .gp { color: #000099; font-weight: bold } /* Generic.Prompt */ +.codehilite .gs { font-weight: bold } /* Generic.Strong */ +.codehilite .gu { color: #003300; font-weight: bold } /* Generic.Subheading */ +.codehilite .gt { color: #99CC66 } /* Generic.Traceback */ +.codehilite .kc { color: #00BBFF; font-weight: bold } /* Keyword.Constant */ +.codehilite .kd { color: #00BBFF; font-weight: bold } /* Keyword.Declaration */ +.codehilite .kn { color: #00BBFF; font-weight: bold } /* Keyword.Namespace */ +.codehilite .kp { color: #00BBFF } /* Keyword.Pseudo */ +.codehilite .kr { color: #00BBFF; font-weight: bold } /* Keyword.Reserved */ +.codehilite .kt { color: #00DDFF; font-weight: bold } /* Keyword.Type */ +.codehilite .m { color: #FF6600 } /* Literal.Number */ +.codehilite .s { color: #CC3300 } /* Literal.String */ +.codehilite .na { color: #330099 } /* Name.Attribute */ +.codehilite .nb { color: #336666 } /* Name.Builtin */ +.codehilite .nc { color: #00AA88; font-weight: bold } /* Name.Class */ +.codehilite .no { color: #336600 } /* Name.Constant */ +.codehilite .nd { color: #9999FF } /* Name.Decorator */ +.codehilite .ni { color: #999999; font-weight: bold } /* Name.Entity */ +.codehilite .ne { color: #CC0000; font-weight: bold } /* Name.Exception */ +.codehilite .nf { color: #CC00FF } /* Name.Function */ +.codehilite .nl { color: #9999FF } /* Name.Label */ +.codehilite .nn { color: #00CCFF; font-weight: bold } /* Name.Namespace */ +.codehilite .nt { color: #330099; font-weight: bold } /* Name.Tag */ +.codehilite .nv { color: #CCFFFF } /* Name.Variable */ +.codehilite .ow { color: #000000; font-weight: bold } /* Operator.Word */ +.codehilite .w { color: #bbbbbb } /* Text.Whitespace */ +.codehilite .mb { color: #FF6600 } /* Literal.Number.Bin */ +.codehilite .mf { color: #FF6600 } /* Literal.Number.Float */ +.codehilite .mh { color: #FF6600 } /* Literal.Number.Hex */ +.codehilite .mi { color: #FF6600 } /* Literal.Number.Integer */ +.codehilite .mo { color: #FF6600 } /* Literal.Number.Oct */ +.codehilite .sa { color: #CC3300 } /* Literal.String.Affix */ +.codehilite .sb { color: #CC3300 } /* Literal.String.Backtick */ +.codehilite .sc { color: #CC3300 } /* Literal.String.Char */ +.codehilite .dl { color: #CC3300 } /* Literal.String.Delimiter */ +.codehilite .sd { color: #CC3300; font-style: italic } /* Literal.String.Doc */ +.codehilite .s2 { color: #CC3300 } /* Literal.String.Double */ +.codehilite .se { color: #CC3300; font-weight: bold } /* Literal.String.Escape */ +.codehilite .sh { color: #CC3300 } /* Literal.String.Heredoc */ +.codehilite .si { color: #AA0000 } /* Literal.String.Interpol */ +.codehilite .sx { color: #CC3300 } /* Literal.String.Other */ +.codehilite .sr { color: #33AAAA } /* Literal.String.Regex */ +.codehilite .s1 { color: #CC3300 } /* Literal.String.Single */ +.codehilite .ss { color: #FFCC33 } /* Literal.String.Symbol */ +.codehilite .bp { color: #336666 } /* Name.Builtin.Pseudo */ +.codehilite .fm { color: #CC00FF } /* Name.Function.Magic */ +.codehilite .vc { color: #CCFFFF } /* Name.Variable.Class */ +.codehilite .vg { color: #CCFFFF } /* Name.Variable.Global */ +.codehilite .vi { color: #CCFFFF } /* Name.Variable.Instance */ +.codehilite .vm { color: #CCFFFF } /* Name.Variable.Magic */ +.codehilite .il { color: #FF6600 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/dst/QScript/Contributing/API/Structs/QCFunc.html b/dst/QScript/Contributing/API/Structs/QCFunc.html index d3b8afa..85fc070 100644 --- a/dst/QScript/Contributing/API/Structs/QCFunc.html +++ b/dst/QScript/Contributing/API/Structs/QCFunc.html @@ -1,8 +1,8 @@ SourceBox Wiki +

QCFunc

+

A QCFunc is a function that looks like this:

+ +
QReturn MyQCFunc(QScriptArgs args) 
+{
+    ...
+}
+
+ +

It takes a QScriptArgs handle and returns a QReturn struct

+
\ No newline at end of file diff --git a/dst/QScript/Contributing/API/Structs/QModuleDefFunc.html b/dst/QScript/Contributing/API/Structs/QModuleDefFunc.html index 189fdaa..0ac5067 100644 --- a/dst/QScript/Contributing/API/Structs/QModuleDefFunc.html +++ b/dst/QScript/Contributing/API/Structs/QModuleDefFunc.html @@ -1,8 +1,8 @@ SourceBox Wiki +

QModuleDefFunc

+
struct QModuleDefFunc
+{
+    QCFunc func;
+    const char* name;
+    enum QType ret;
+    const char* types;
+};
+
+ +

QModuleDefFunc is used for defining functions that QScript will bind to the scripting languages.

+ +

types is a string of characters that represent the types of parameters which the function accepts. QScript will automatically check the types for you, so do not worry about checking them yourself.

+ +

Here is a list of all the types and their characters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
charQType
sQType_String
iQType_Int
fQType_Float
oQType_Object
bQType_Bool
pQType_Function
+ +

ret is what the function will return.

+ +

func is a QCFunc which will be called when a scripting langauge calls your function.

+ +

Here is an example list of QModuleDefFuncs which you pass to CreateModule

+ +
static QModuleDefFunc sourcebox_client[] = {
+    {QScriptClientMsg,"Msg",QType_None,"s"},
+    {RegisterCmd,"RegisterCmd",QType_None,"sp"},
+    {0,0,QType_None,0}
+    //{RegisterCmd,"RegisterCmd",QType_None,"sp"},
+};
+
+
\ No newline at end of file diff --git a/dst/QScript/Contributing/API/Structs/QReturn.html b/dst/QScript/Contributing/API/Structs/QReturn.html new file mode 100644 index 0000000..528292d --- /dev/null +++ b/dst/QScript/Contributing/API/Structs/QReturn.html @@ -0,0 +1,380 @@ + +SourceBox Wiki + + + +
+
+ + +
+

QReturn

+ +
struct QReturn
+{
+    enum QType type;
+    QValue value;
+};
+
+ +

QReturn is a struct which contains a QType and a QValue

+ +

The data in the QValue must match the QType.

+ +
\ No newline at end of file diff --git a/dst/QScript/Contributing/API/Structs/QScriptArgs.html b/dst/QScript/Contributing/API/Structs/QScriptArgs.html new file mode 100644 index 0000000..c4d37da --- /dev/null +++ b/dst/QScript/Contributing/API/Structs/QScriptArgs.html @@ -0,0 +1,371 @@ + +SourceBox Wiki + + + +
+
+ + +
+

QScriptArgs

+ +

QScriptArgs is a handle to a QArgs struct. Is used in QCFunc.

+ +
\ No newline at end of file diff --git a/dst/QScript/Contributing/API/Structs/QScriptCallback.html b/dst/QScript/Contributing/API/Structs/QScriptCallback.html index 87c665a..1d9ac63 100644 --- a/dst/QScript/Contributing/API/Structs/QScriptCallback.html +++ b/dst/QScript/Contributing/API/Structs/QScriptCallback.html @@ -1,8 +1,8 @@ SourceBox Wiki +

QScriptCallback

+

QScriptCallback is used for calling scripting language functions from C++. It is a handle to a QCallback struct.

+
\ No newline at end of file diff --git a/dst/QScript/Contributing/API/Structs/QScriptClass.html b/dst/QScript/Contributing/API/Structs/QScriptClass.html index 7961a02..8e02e2a 100644 --- a/dst/QScript/Contributing/API/Structs/QScriptClass.html +++ b/dst/QScript/Contributing/API/Structs/QScriptClass.html @@ -1,8 +1,8 @@ SourceBox Wiki +

QScriptClass

+

QScriptClass is a handle to a QClass struct.

+
\ No newline at end of file diff --git a/dst/QScript/Contributing/API/Structs/QScriptClassCreator.html b/dst/QScript/Contributing/API/Structs/QScriptClassCreator.html index 9671760..c5ca6cc 100644 --- a/dst/QScript/Contributing/API/Structs/QScriptClassCreator.html +++ b/dst/QScript/Contributing/API/Structs/QScriptClassCreator.html @@ -1,8 +1,8 @@ SourceBox Wiki +

QScriptClassCreator

+

QScriptClassCreator is a handle to a QClassCreator struct. It is used for defining QScriptClasses.

+
\ No newline at end of file diff --git a/dst/QScript/Contributing/API/Structs/QType.html b/dst/QScript/Contributing/API/Structs/QType.html index a701af8..a40b621 100644 --- a/dst/QScript/Contributing/API/Structs/QType.html +++ b/dst/QScript/Contributing/API/Structs/QType.html @@ -1,8 +1,8 @@ SourceBox Wiki +

QType

+
enum QType
+{
+    QType_None = 0,
+    QType_Int,
+    QType_Float,
+    QType_String,
+    QType_Bool,
+    QType_Object,
+    QType_Function
+};
+
+ +

QType is an enum which represents a QScript type.

+
\ No newline at end of file diff --git a/dst/QScript/Contributing/API/Structs/QValue.html b/dst/QScript/Contributing/API/Structs/QValue.html index 209c245..ae12e7a 100644 --- a/dst/QScript/Contributing/API/Structs/QValue.html +++ b/dst/QScript/Contributing/API/Structs/QValue.html @@ -1,8 +1,8 @@ SourceBox Wiki +

QValue

+
union QValue
+{
+    int value_int;
+    float value_float;
+    const char* value_string;
+    char* value_modifiable_string;
+    bool value_bool;
+    QScriptFunction value_function;
+    QScriptObject value_object;
+};
+
+ +

QValue is used everywhere in QScript. It is used for storing all sorts of values.

+
\ No newline at end of file diff --git a/dst/QScript/Contributing/API/qscript.html b/dst/QScript/Contributing/API/qscript.html index 07a0dca..3d0511d 100644 --- a/dst/QScript/Contributing/API/qscript.html +++ b/dst/QScript/Contributing/API/qscript.html @@ -1,8 +1,8 @@ SourceBox Wiki +