finally update the site

This commit is contained in:
Lazy Hippopotamus
2024-03-23 10:16:59 -04:00
parent 78bbd40557
commit a611d01a71
6 changed files with 39 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
[?][@on minify] [?][@on minify]
[=baseurl http://localhost:8080] [=baseurl http://localhost:8080]
[i config production] [i production]
[=baseurl https://swaous.asuscomm.com/sitix] [=baseurl https://swaous.asuscomm.com/sitix]
[/] [/]

View File

@@ -28,13 +28,14 @@
model with efficient file includes, conditional branching, looping, and command-line configuration to make stunning websites without the mess. model with efficient file includes, conditional branching, looping, and command-line configuration to make stunning websites without the mess.
</div> </div>
[=textimage_text-] [=textimage_text-]
Template all the things. Any Sitix file can be a template; the \[?] opening phrase indicates that (for whatever reason) the file shouldn't be rendered normally, Template all the things. Any Sitix file can be a template; the \[?\] opening phrase indicates that (for whatever reason) the file shouldn't be rendered normally,
but still may be included in other files - for configuration, templating, or even modular elements! but still may be included in other files - for configuration, templating, or even modular elements!
[/][=textimage_source-][^baseurl]/res/default.html.png[/][^textimage] [/]
[=textimage_source-] [^baseurl]/res/default.html.png [/] [^textimage]
[=textimage_text-] [=textimage_text-]
Sitix is a universal preprocessor. HTML? Of course. CSS? Yep! JavaScript? Certainly! Sitix will template anything, whether it be a nice simple HTML file or a hand-edited GIF Sitix is a universal preprocessor. HTML? Of course. CSS? Yep! JavaScript? Certainly! Sitix will template anything, whether it be a nice simple HTML file or a hand-edited GIF
from 1998. Say goodbye to annoying configuration discrepancies between CSS and HTML and JavaScript - just throw your shared variables in a config.stx file and let Sitix do the rest! from 1998. Say goodbye to annoying configuration discrepancies between CSS and HTML and JavaScript - just throw your shared variables in a config.stx file and let Sitix do the rest!
[/][=textimage_source-][^baseurl]/res/lato.css.png[/][^textimage] [/] [=textimage_source-] [^baseurl]/res/lato.css.png[/] [^textimage]
<div class="text scrolly" style="font-size: 2em;"> <div class="text scrolly" style="font-size: 2em;">
No more restrictive project structures, irritating configuration files, or <b>magic</b>. Goodbye Ruby, "blog-awareness", difficult configuration, and bulky outputs. No more restrictive project structures, irritating configuration files, or <b>magic</b>. Goodbye Ruby, "blog-awareness", difficult configuration, and bulky outputs.
Sayonara obtuse frameworks, inefficient CSR, and annoying build pipelines. Sayonara obtuse frameworks, inefficient CSR, and annoying build pipelines.

View File

@@ -7,6 +7,13 @@
periodically for information on new releases, design considerations, known bugs, etc. You can think of it as a miniblog. periodically for information on new releases, design considerations, known bugs, etc. You can think of it as a miniblog.
</div> </div>
<div class="text"> <div class="text">
<b>2024-3-23:</b> Added Evals. It's a simple evaluated stack-based language designed specifically for Sitix. At the moment, all it does is compare things, but it's
a damn sight better than how if statements used to work. Eventually I'll add vscript to inline object (<code>\[=name content]</code>) directives; for now,
it's present in if statements and the <code>\[v]</code> directive.<br>
In other news, the program is a LOT cleaner now. Much of the processing effort has been moved into constructors and a lot of things have been simplified and
abstracted. Memory maps are now automatically unmapped and have a very pleasant buffer-like interface, and all the mapping code has been moved to a single function.<br>
The project is now ready for MarkDown!
<br><br>
<b>2024-3-11:</b> Model updates, and now this site can actually be built by the latest sitix updates :D.<br> <b>2024-3-11:</b> Model updates, and now this site can actually be built by the latest sitix updates :D.<br>
As of today, Sitix now leaks no memory when building this site! It took a lot of effort to trim down but it was worth it. We shall see if the luck persists. As of today, Sitix now leaks no memory when building this site! It took a lot of effort to trim down but it was worth it. We shall see if the luck persists.
<br><br> <br><br>

View File

@@ -9,11 +9,8 @@
<div class="text"> <div class="text">
<ul> <ul>
<li>Markdown support with an @-directive</li> <li>Markdown support with an @-directive</li>
<li>Code cleaning (use smart pointers and std::strings as much as possible rather than... <i>this</i>)</li>
<li>Make config less hack (move from \[i config] to \[i exists], and create empty objects on global with -c)</li>
<li>Add an unpack/ghost operator so setting objects to other objects works (something like \[=ghostingName-] \[%ghostedObject] \[/])</li>
<li>Safety: Sitix should not delete your entire codebase if you accidentally mistype the command.</li> <li>Safety: Sitix should not delete your entire codebase if you accidentally mistype the command.</li>
<li>Get rid of that stupid "something has gone terribly wrong" warning. It's not a problem, it's just an artefact of an old debugging marathon.</li> <li>Use Evals more widely and implement string manipulation.</li>
</ul> </ul>
</div> </div>
[/] [/]

View File

@@ -10,7 +10,10 @@
your <code>site</code> directory, creating appropriate subdirectories and directly copying over any file that doesn't have an opening phrase - <code>\[!]</code>, your <code>site</code> directory, creating appropriate subdirectories and directly copying over any file that doesn't have an opening phrase - <code>\[!]</code>,
for a Sitix page, or <code>\[?]</code> for a data page (which will not be rendered itself, but may be used for templating or configuration). The opening phrase for a Sitix page, or <code>\[?]</code> for a data page (which will not be rendered itself, but may be used for templating or configuration). The opening phrase
MUST be the first three bytes of the file; if there are any whitespaces before it, the file will be treated as plain data. If you want MUST be the first three bytes of the file; if there are any whitespaces before it, the file will be treated as plain data. If you want
it to render to a different directory, pass the <code>-o location</code> flag. it to render to a different directory, pass the <code>-o location</code> flag.<br><br>
Configuration can be managed with the <code>-c</code> command line directive, which directly inserts a Sitix object to the virtual root scope. For instance,
this site uses the <code>-c production</code> argument to enable the production endpoint as opposed to the local development endpoint. It could also be
something like <code>-c endpoint https://swaous.asuscomm.com/sitix</code>, directly inserting the endpoint.
</div> </div>
<div class="note"> <div class="note">
WARNING: <code>-o</code> is very dangerous! If you tell Sitix to render to a directory with important information in it, <b>that directory is as good as gone</b>. WARNING: <code>-o</code> is very dangerous! If you tell Sitix to render to a directory with important information in it, <b>that directory is as good as gone</b>.
@@ -29,16 +32,8 @@
Variables at the dereferencing position will NOT be replaced.</li> Variables at the dereferencing position will NOT be replaced.</li>
<li><code>\[#filename]</code>: Dereferences a Sitix file (or plain file, which would just copy over content without processing it) at this position. The filename must be relative <li><code>\[#filename]</code>: Dereferences a Sitix file (or plain file, which would just copy over content without processing it) at this position. The filename must be relative
to the root directory (usually the <code>site</code> directory), rather than the directory the including file is stored in. This is very useful for templating.</li> to the root directory (usually the <code>site</code> directory), rather than the directory the including file is stored in. This is very useful for templating.</li>
<li><code>\[i request &lt;...&gt;]\[e]\[/]</code>: This is an if condition. If in Sitix contains an object (between the <code>\[i]</code> and either <code>\[/]</code> or <code>\[e]</code>) that will <li><code>\[i &lt;...&gt;]main section\[e]else section\[/]</code>: This is an if condition. The content of the condition is an Evals directive. If it's truthy, the main section of the
be rendered if the condition evaluates to "true", and, optionally (between <code>\[e]</code> and <code>\[/]</code>), an object that will be rendered if the condition is false.<br> if statement will be rendered. If it's not truthy, the else section will be rendered. You can put whatever you want in either section. For more information on Evals, see below.</li>
Requests can be,
<ul>
<li><code>config configName</code>: Check whether or not a command-line config switch is enabled (you can enable them with <code>-c configName</code>).</li>
<li><code>equals variable1 variable2</code>: Check whether two variables are the same (the check is flawed, but pretty good. See the relevant section in <code>main.cpp</code>
for information on this.)</li>
<li><code>exists variable</code>: Check whether a variable exists. Good for simple boolean flags.</li>
</ul>
</li>
<li><code>\[f array iterator]</code>: For loop that iterates over an array (note: in Sitix, every subdirectory of the root dir can be treated as <li><code>\[f array iterator]</code>: For loop that iterates over an array (note: in Sitix, every subdirectory of the root dir can be treated as
an array of objects, each object being a file! This allows things like generating blog links). The <code>iterator</code> variable will be, for every item, an array of objects, each object being a file! This allows things like generating blog links). The <code>iterator</code> variable will be, for every item,
the referenced array element. <b>Note: When iterating over a directory, every file will be given a <code>filename</code> property!</b> This can be used like the referenced array element. <b>Note: When iterating over a directory, every file will be given a <code>filename</code> property!</b> This can be used like
@@ -53,6 +48,24 @@
except in <i>very</i> niche situations, because of the unclear rules behind it; I will document those on a later date. __file__ is always the root object of the current file, except in <i>very</i> niche situations, because of the unclear rules behind it; I will document those on a later date. __file__ is always the root object of the current file,
- you can most likely guess why that's useful. - you can most likely guess why that's useful.
</div> </div>
<div class="text">
Evals is a very simple stack-based language meant for evaluating string statements. When data is entered in the Evals program, it's immediately pushed
to the stack (like <code>"hello"</code>, <code>3.14</code>, <code>true</code>, or <code>some.sitix.variable</code>). At the end of Evals rendering, whatever is left on the stack
is considered the result (if there is more than one thing on the stack, Evals will give you a Bad Syntax error and return an ErrorObject). To manipulate data,
there are a number of commands that work on the top of the stack:
<ul>
<li><code>equals</code>: Checks if two values on the stack are equal to each other. It will remove both values from the stack and add a boolean value as the result.</li>
<li><code>not</code>: Pops the top value off the stack and replaces it with a boolean equal to the opposite of the truthyness of that object. <code>"Hello World" not</code>
would just be <code>false</code>, for instance.</li>
</ul>
Truthyness in Evals is not dissimilar to JavaScript. Empty strings are falsey, and all other strings are truthy; 0 is falsey and all other numbers are truthy, and booleans are truthy or falsey based on their value.
Sitix variables are considered truthy if the lookup is successful, and falsey otherwise; this allows for a replacement to the old <code>\[i exists]</code> and <code>\[i config]</code>,
like <code>\[i conf/prod]</code> would check if the <code>conf/prod</code> variable exists in scope (which could be set by <code>-c conf/prod</code>, for instance).
Evals will render Sitix variables as strings to run comparisons on them. This means you must be careful - if rendering that object would change a variable you don't want changed, for instance,
you'll end up with some very odd behavior. Rendering objects to strings is also dangerous because of the sheer size of some Sitix objects - you can store many gigabytes of data safely in
a PlainText object, which would be forced into main memory by an Evals comparison (Evals will not render Sitix objects unless they're used in a comparison with a string; comparing
two Sitix objects is safe). Be careful.
</div>
<div class="text"> <div class="text">
And that's it! To see how these are used creatively in the wild, check out <a href="https://github.com/LinuxRocks2000/sitix-website">the source code for this website</a>. And that's it! To see how these are used creatively in the wild, check out <a href="https://github.com/LinuxRocks2000/sitix-website">the source code for this website</a>.
</div> </div>

View File

@@ -9,7 +9,7 @@
<link rel="stylesheet" href="[^baseurl]/res/lato/lato.css"> <link rel="stylesheet" href="[^baseurl]/res/lato/lato.css">
<link rel="icon" href="[^baseurl]/res/sitix.svg"> <link rel="icon" href="[^baseurl]/res/sitix.svg">
<title>Sitix | <title>Sitix |
[i exists title] [i title]
[^title] [^title]
[e] [e]
Untitled Page Untitled Page
@@ -26,7 +26,7 @@
</div> </div>
</div> </div>
<div id="main" class="scrolly-container"> <div id="main" class="scrolly-container">
[i exists isSimple] [i isSimple]
<h2>[^title]</h2> <h2>[^title]</h2>
[/] [/]
[^content] [^content]