move page
This commit is contained in:
@@ -174,7 +174,7 @@ footer {
|
||||
<main>
|
||||
<header>
|
||||
<h1>Documentation</h1>
|
||||
<p>Fes: A lightweight, static, and opinionated microframework.</p>
|
||||
<p>Yait: Yet Another Init Tool</p>
|
||||
</header>
|
||||
|
||||
<nav>
|
||||
@@ -182,62 +182,29 @@ footer {
|
||||
<ul>
|
||||
<li><a href="#introduction">Introduction</a></li>
|
||||
<li><a href="#installation">Installation</a></li>
|
||||
<li><a href="#usage">Usage</a></li>
|
||||
<li><a href="#quick">Quick Start</a></li>
|
||||
<li><a href="#cli-reference">Cli Reference</a></li>
|
||||
<li><a href="#reference">Reference</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<section id="introduction">
|
||||
<h2>Introduction</h2>
|
||||
<p>Fes, or Free Easy Site, is a microframework used for small static sites. It is not designed for complex web applications and that is why it is good. Yes, I hate modern web and that is the reason this exists.</p>
|
||||
<p>Yait, or Yet Another Init Tool, is a small shell script that templates minimal programs. It provides argument parsing and a general framework for your projects.</p>
|
||||
</section>
|
||||
|
||||
<section id="installation">
|
||||
<h2>Installation</h2>
|
||||
<pre><code>git clone https://git.vxserver.dev/fSD/fes</code></pre>
|
||||
<pre><code>git clone https://git.vxserver.dev/fSD/yait</code></pre>
|
||||
<pre><code>cd fes</code></pre>
|
||||
<pre><code>go install fes</code></pre>
|
||||
</section>
|
||||
|
||||
<section id="usage">
|
||||
<h2>Usage</h2>
|
||||
<p>Typical workflows and examples.</p>
|
||||
<ul>
|
||||
<li>Creating project</li>
|
||||
<li>Hosting websites</li>
|
||||
<li>Generating websites</li>
|
||||
</ul>
|
||||
<pre><code>sudo make install</code></pre>
|
||||
</section>
|
||||
|
||||
<section id="quick">
|
||||
<h2>Quick Start</h2>
|
||||
<pre><code>fes new hello</code></pre>
|
||||
<p>This creates a new project under the name <code>hello</code>.</p>
|
||||
<pre><code>fes run hello</code></pre>
|
||||
<p>This runs your project <code>hello</code>, by default at <a href="localhost:3000" target="_blank">localhost:3000</a>.</p>
|
||||
<h3>Extensions</h3>
|
||||
<p>Let's add a paragraph to this simple site. Right now you have the following page:</p>
|
||||
<pre><code>local fes = require("fes")
|
||||
local site = fes.fes()
|
||||
|
||||
-- site.copyright = fes.util.copyright("https://fsd.vxserver.dev", "vx-clutch")
|
||||
|
||||
site:h1("Hello, World!")
|
||||
|
||||
return site</code></pre>
|
||||
<p>To add a simple paragraph modify like so:</p>
|
||||
<pre><code>local fes = require("fes")
|
||||
local site = fes.fes()
|
||||
|
||||
-- site.copyright = fes.util.copyright("https://fsd.vxserver.dev", "vx-clutch")
|
||||
|
||||
site:h1("Hello, World!")
|
||||
site:p("This is a paragraph")
|
||||
|
||||
return site</code></pre>
|
||||
</section>
|
||||
<pre><code>yait hello</code></pre>
|
||||
<p>This creates a C project.</p>
|
||||
<pre><code>yait -x sh hello</code></pre>
|
||||
<p>This creates a SH project.</p>
|
||||
|
||||
<section id="cli-reference">
|
||||
<h2>Cli Reference</h2>
|
||||
@@ -249,492 +216,40 @@ return site</code></pre>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>new <project></code></td>
|
||||
<td>Create a new projet called <project></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>doc</code></td>
|
||||
<td>Open this documention page</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>run <project></code></td>
|
||||
<td>Run the projet called <project></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>-help</code></td>
|
||||
<td><code>--help</code></td>
|
||||
<td>Display help information.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>-V1</code></td>
|
||||
<td>Print extended version information, this is very helpful when it comes to bug reporting.</td>
|
||||
<td><code>--version</code></td>
|
||||
<td>Print version information.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>-no-color</code></td>
|
||||
<td><code>-x <language></code></td>
|
||||
<td>Set project language.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>-d <description></code></td>
|
||||
<td>Set a description.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>-S</code></td>
|
||||
<td>small project creation (only for shell scripts)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>-f</code></td>
|
||||
<td>overwrite existing files</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>-d <author></code></td>
|
||||
<td>Disable color output.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>-p <port></code></td>
|
||||
<td>Set the server port.</td>
|
||||
<td><code>-r</code></td>
|
||||
<td>Initalize a Git repository.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>-version</code></td>
|
||||
<td>Print the version.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section id="reference">
|
||||
<h2>Reference</h2>
|
||||
All <code>std</code> functions have binding for the site and can be used like so: <code>site:h1("Hello, World!")</code>, where site is the site object.
|
||||
<h3>Builtin</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>fes()</code></td>
|
||||
<td>Generate a site object</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>:g()</code></td>
|
||||
<td>Add a custom string to the site body</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>markdown_to_html(str: string)</code></td>
|
||||
<td>Returns generated HTML from provided Markdown string.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3>Std</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>std.a(link: string, str: string)</code></td>
|
||||
<td>Returns an anchor tag.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.ha(link: string, str: string)</code></td>
|
||||
<td>Returns an anchor tag with sytiling to make it hidden.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.external(link: string, str: string)</code></td>
|
||||
<td>Returns an anchor tag that opens up in a new tab.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.note(str: string)</code></td>
|
||||
<td>Returns a note object.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.muted(str: string)</code></td>
|
||||
<td>Returns a muted object.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.callout(str: string)</code></td>
|
||||
<td>Returns a callout object.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.h1(str: string)</code></td>
|
||||
<td>Returns a header level 1 object.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.h2(str: string)</code></td>
|
||||
<td>Returns a header level 2 object.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.h3(str: string)</code></td>
|
||||
<td>Returns a header level 3 object.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.h4(str: string)</code></td>
|
||||
<td>Returns a header level 4 object.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.h5(str: string)</code></td>
|
||||
<td>Returns a header level 5 object.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.h6(str: string)</code></td>
|
||||
<td>Returns a header level 6 object.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.p(str: string)</code></td>
|
||||
<td>Returns a paragraph object.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.pre(str: string)</code></td>
|
||||
<td>Returns preformated text.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.code(str: string)</code></td>
|
||||
<td>Returns a codeblock.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.ul(items: {...strings})</code></td>
|
||||
<td>Generates an unordered list from a table of strings.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.ol(items: {...strings})</code></td>
|
||||
<td>Generates an ordered list from a table of strings.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.tl(items: {...strings})</code></td>
|
||||
<td>Generates a table from a table of strings.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.blockquote(str: string)</code></td>
|
||||
<td>Returns a blockquote.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.hr()</code></td>
|
||||
<td>Returns a horizonal rule.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.img(src: string, alt: string)</code></td>
|
||||
<td>Returns an image at location source with given alternative text.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.strong(str: string)</code></td>
|
||||
<td>Returns bolded text.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.em(str: string)</code></td>
|
||||
<td>Returns italicized text.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.br()</code></td>
|
||||
<td>Returns a break.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.div(content: string, class: string)</code></td>
|
||||
<td>Returns a div of class <code>class</code> with content of <code>content</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.span(content: string, class: string)</code></td>
|
||||
<td>Returns a span of class <code>class</code> with content of <code>content</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.escape(str: string)</code></td>
|
||||
<td>Returns an html escaped string.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.highlight(str: string)</code></td>
|
||||
<td>Returns highlighted text.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.banner(str: string)</code></td>
|
||||
<td>Returns a banner that is attached to the top of the site.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.center(str: string)</code></td>
|
||||
<td>Returns centered text.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.nav(link: string, str: string)</code></td>
|
||||
<td>Returns a speical navigation link, used for in-site traversal.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>std.rl(r: string, l: string)</code></td>
|
||||
<td>Right and light alight content.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3>Symbol</h3>
|
||||
<table> <thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Symbol</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>symbol.legal.copyright</code></td>
|
||||
<td>©</td> </tr>
|
||||
<tr>
|
||||
<td><code>symbol.legal.registered_trademark</code></td>
|
||||
<td>®</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.legal.trademark</code></td>
|
||||
<td>™</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.currency.euro</code></td>
|
||||
<td>€</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.currency.pound</code></td>
|
||||
<td>£</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.currency.yen</code></td>
|
||||
<td>¥</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.currency.cent</code></td>
|
||||
<td>¢</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.currency.dollar</code></td>
|
||||
<td>$</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.currency.plus_minus</code></td>
|
||||
<td>±</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.currency.multiply</code></td>
|
||||
<td>×</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.currency.divide</code></td>
|
||||
<td>÷</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.currency.not_equal</code></td>
|
||||
<td>≠</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.currency.less_equal</code></td>
|
||||
<td>≤</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.currency.greater_equal</code></td>
|
||||
<td>≥</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.currency.infinity</code></td>
|
||||
<td>∞</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.currency.approx</code></td>
|
||||
<td>≈</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.arrows.left</code></td>
|
||||
<td>←</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.arrows.right</code></td>
|
||||
<td>→</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.arrows.up</code></td>
|
||||
<td>↑</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.arrows.down</code></td>
|
||||
<td>↓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.arrows.left_right</code></td>
|
||||
<td>↔</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.punctuation.left_double_quote</code></td>
|
||||
<td>“</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.punctuation.right_double_quote</code></td>
|
||||
<td>”</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.punctuation.left_single_quote</code></td>
|
||||
<td>‘</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.punctuation.right_single_quote</code></td>
|
||||
<td>’</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.punctuation.ellipsis</code></td>
|
||||
<td>…</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.punctuation.em_dash</code></td>
|
||||
<td>—</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.punctuation.en_dash</code></td>
|
||||
<td>–</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.whitespace.non_breaking</code></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.whitespace.thin</code></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.symbols.degree</code></td>
|
||||
<td>°</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.symbols.micro</code></td>
|
||||
<td>µ</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.symbols.section</code></td>
|
||||
<td>§</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.symbols.paragraph</code></td>
|
||||
<td>¶</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.symbols.check</code></td>
|
||||
<td>✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.symbols.cross</code></td>
|
||||
<td>✗</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.symbols.bullet</code></td>
|
||||
<td>•</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.symbols.middle_dot</code></td>
|
||||
<td>·</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.symbols.broken_bar</code></td>
|
||||
<td>¦</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.html.less_than</code></td>
|
||||
<td><</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.html.greater_than</code></td>
|
||||
<td>></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.html.ampersand</code></td>
|
||||
<td>&</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.html.double_quote</code></td>
|
||||
<td>"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>symbol.html.single_quote</code></td>
|
||||
<td>'</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3>Util</h3>
|
||||
<table> <thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>util.cc(tbl: {...strings})</code></td>
|
||||
<td>Concatenate a table of strings into a single string.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>util.copyright(link: string, holder: string)</code></td>
|
||||
<td>Used when setting the website copyright holder.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3>Dkjson</h3>
|
||||
This is a third party object and is best documented <a href="https://dkolf.de/dkjson-lua/documentation" target="_blank">here</a>
|
||||
<table> <thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>dkjson.encode(obj: {...any})</code></td>
|
||||
<td>Serilize a Lua table into JSON.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>dkjson.decode(obj: {...any})</code></td>
|
||||
<td>Deserilize JSON into a Lua table.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3>Bus</h3>
|
||||
<table> <thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>bus.url</code></td>
|
||||
<td>The current url that was given.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>bus.params</code></td>
|
||||
<td>A table of url parameters if any. Ex: ?foo=bar*baz=foobar</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3>App</h3>
|
||||
Fes's <code>app</code> module is a special table
|
||||
because it contains user defined functions. These
|
||||
functions are defined in the <code>include/</code> For
|
||||
example if you define a <code>include/hello.lua</code>
|
||||
file with given contents: <pre><code>local hello = {}
|
||||
|
||||
hello.render(std) return std.h1("Hello, World!") end
|
||||
|
||||
return hello</pre></code> This can be called from another with,
|
||||
<code>fes.app.hello.render(fes.std)</code>. Do with this
|
||||
as you will.
|
||||
<h3>Speical Directories</h3>
|
||||
<table> <thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>www/</code></td>
|
||||
<td>The main website is
|
||||
contained here, this is
|
||||
where www/index.lua
|
||||
lives.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>static/</code></td>
|
||||
<td>All static content should
|
||||
be placed here and can
|
||||
be accessed at
|
||||
<code>/static/path-to-file</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>include/</code></td>
|
||||
<td>Contains lua files that are
|
||||
preloaded and globally
|
||||
accessible.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>archive/</code></td>
|
||||
<td>Files here can be viewed in
|
||||
a file browser like
|
||||
format at
|
||||
<code>/archive/path-to-dir</code>.</td>
|
||||
<td><code>-q</code></td>
|
||||
<td>Suppress non-critical output.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user