From 76eb4809e2f19ff61d9d9b3e46b32ab4a4a98c3d Mon Sep 17 00:00:00 2001 From: vx-clutch Date: Tue, 2 Dec 2025 21:10:34 -0500 Subject: [PATCH] alpha p1 --- docs.vxserver.dev/Fes.toml | 5 + docs.vxserver.dev/include/header.lua | 9 ++ docs.vxserver.dev/www/index.lua | 17 +++ fsd.vxserver.dev/Fes.toml | 8 +- fsd.vxserver.dev/article/alpha-release.md | 10 -- fsd.vxserver.dev/article/holiday-season.md | 3 - fsd.vxserver.dev/image/favicon.ico | Bin 0 -> 1150 bytes fsd.vxserver.dev/include/favicon.ico | Bin 15406 -> 0 bytes fsd.vxserver.dev/include/footer.lua | 2 +- fsd.vxserver.dev/include/snippet.lua | 155 ++++++++++++++++----- fsd.vxserver.dev/news/00-happy-holidays.md | 7 + fsd.vxserver.dev/news/01-alpha-release.md | 32 +++++ fsd.vxserver.dev/www/about.lua | 28 +++- fsd.vxserver.dev/www/news.lua | 123 ++++++++++------ fsd.vxserver.dev/www/release.lua | 31 +++-- 15 files changed, 327 insertions(+), 103 deletions(-) create mode 100644 docs.vxserver.dev/Fes.toml create mode 100644 docs.vxserver.dev/include/header.lua create mode 100644 docs.vxserver.dev/www/index.lua delete mode 100644 fsd.vxserver.dev/article/alpha-release.md delete mode 100644 fsd.vxserver.dev/article/holiday-season.md create mode 100644 fsd.vxserver.dev/image/favicon.ico delete mode 100644 fsd.vxserver.dev/include/favicon.ico create mode 100644 fsd.vxserver.dev/news/00-happy-holidays.md create mode 100644 fsd.vxserver.dev/news/01-alpha-release.md diff --git a/docs.vxserver.dev/Fes.toml b/docs.vxserver.dev/Fes.toml new file mode 100644 index 0000000..58f1ab6 --- /dev/null +++ b/docs.vxserver.dev/Fes.toml @@ -0,0 +1,5 @@ +[app] + +name = "docs.vxserver.dev" +version = "0.0.1" +authors = ["vx-clutch"] \ No newline at end of file diff --git a/docs.vxserver.dev/include/header.lua b/docs.vxserver.dev/include/header.lua new file mode 100644 index 0000000..dd38be4 --- /dev/null +++ b/docs.vxserver.dev/include/header.lua @@ -0,0 +1,9 @@ +local header = {} + +header.render = function(std) + return table.concat({ + std.center(std.h1("Free Software Distributions Documentation")), + }) +end + +return header diff --git a/docs.vxserver.dev/www/index.lua b/docs.vxserver.dev/www/index.lua new file mode 100644 index 0000000..83e73b0 --- /dev/null +++ b/docs.vxserver.dev/www/index.lua @@ -0,0 +1,17 @@ +local fes = require("fes") +local std = fes.std +local u = fes.util + +local site = fes.fes() + +site.title = "Free Software Distributions Documentation" +site.copyright = fes.util.copyright("https://git.vxserver.dev/fSD", "fSD") + +site:banner(fes.app.header.render(std)) + +site:note(u.cc({ + std.h1("Free Software Distributions Documentation"), + std.blockquote(std.h1("NOT IMPLEMENTED")), +})) + +return site diff --git a/fsd.vxserver.dev/Fes.toml b/fsd.vxserver.dev/Fes.toml index 77038df..a29be0d 100644 --- a/fsd.vxserver.dev/Fes.toml +++ b/fsd.vxserver.dev/Fes.toml @@ -1,9 +1,5 @@ -[site] +[app] -name = "site" +name = "fsd.vxserver.dev" version = "0.0.1" authors = ["owen"] - -[fes] -version = "1.0.0" -CUSTOM_CSS = diff --git a/fsd.vxserver.dev/article/alpha-release.md b/fsd.vxserver.dev/article/alpha-release.md deleted file mode 100644 index d975231..0000000 --- a/fsd.vxserver.dev/article/alpha-release.md +++ /dev/null @@ -1,10 +0,0 @@ -### Site version alpha release - -This is the alpha version of the fSD website, this site -contains many cool and interesting features which I -suggest that you navigate and learn more about. - -If you think that this experience can be improved -send you suggestion or report to . - -2025-28-11 diff --git a/fsd.vxserver.dev/article/holiday-season.md b/fsd.vxserver.dev/article/holiday-season.md deleted file mode 100644 index 63eb350..0000000 --- a/fsd.vxserver.dev/article/holiday-season.md +++ /dev/null @@ -1,3 +0,0 @@ -### Holiday Season - -Merry Christmas and Happy Holidays! diff --git a/fsd.vxserver.dev/image/favicon.ico b/fsd.vxserver.dev/image/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..8c81a1219b1388d3518bcd45ed170d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LYr|nsmF*`T9 zp}?Sj0=|fgr2SF88lUUjb@FqIV>xkHp0YNPnKNn|I0iYs+-QahgRTScJzZnz4}Ty0 zezyUZ@dXZ*Pd+@h)A^={?O24d!#G<$T8w3$dG^D`aW_2binVf;b)LX^2m4wk#_5J% z3d~J^+MY37FMiM~2EA8TuI!$vH8&rkwe7CL-24$>9kjVhhc>R(f_waYm&3eTSB^Z_ z!1Eku*V7Tl^NQ)fp8c@n^{{EqIn#&pGwL2j8?tYE!unb(o^r3K0Q~N9=&bUX_QynK z-{v~Rvkdn-6-UhnBKoeXRR_KO5D|ScaJEPqwD&&7$QZ+e{w?^*I{rCMxEFK1ekTi^K zW6f$;@rRp-yzUBTj7%!1rp+Juuy?(On8nmA7_qd7{-COZFJ#!>^ks3=IoPXN#UE}S z`kRQs=frrOa#_Z>xY2nBsKVP!@JO$(oZsOCbYFY^N{yZ7YbVC#ZJq+virWQVK|6lf z>!ANm@<%$r___nbR^*zMPnS~a(5D-0LW(R@hPuz^+64WR+Ew}9w22Y8$GuRBj`?UH zdw6kG-0iuJ6|#S2Yit&9KFp^}DRq#&t4NdE(Ge5JzOanzQ^kt?_ISC1>5C+OiuK2O zQ&)x50eIr7qXyf(lBTqfB$3vHGz}pJEoHqhqbijSPG^HI> zw{?%V-grB}RuS);(a(rm+s{jo%{~2Z*1o8|2gMs|z;DF&xtHD&4j!A_M3w|o-T~U^ z)Axmllqpll-ibat#knq9w4m_?4`R&a?+eUd&v!XC9fnijeJz}RGq32bSB7J=^RmU< z!k&1oq;aNP_wd%BF)xoYRr0MGY}sS!fV~d+A=%BpB0kk?9AVA)JO5`x$s{SbV`0$?~SNyLSh%?YNxX(m= zEs3LtBnsmP_J3XKkG3Z;A6j{*7!rNCk+9dnzwt|7%l;whk8v^uefID4xYPT%j=8 - -int main() +int main(void) { long x = 470020878965; - puts((void*)&x); // le representation + puts((void *)&x); return 0; } ]], - [[ -float Q_rsqrt( float number ) +[[ +float Q_rsqrt(float number) { long i; float x2, y; const float threehalfs = 1.5F; - x2 = number * 0.5F; - y = number; - i = * ( long * ) &y; // evil floating point bit level hacking - i = 0x5f3759df - ( i >> 1 ); // what the fuck? - y = * ( float * ) &i; - y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration -// y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed - + y = number; + i = *(long *)&y; + i = 0x5f3759df - (i >> 1); + y = *(float *)&i; + y = y * (threehalfs - (x2 * y * y)); return y; } ]], - [[ +[[ #include int main(int argc, char **argv) { return printf("%s: Comma operator\n", argv[0]), 2; } ]], - [[ +[[ void welford(double x, double *n, double *mean, double *m2) { (*n)++; @@ -45,33 +41,128 @@ void welford(double x, double *n, double *mean, double *m2) *m2 += d * (x - *mean); } ]], - [[ +[[ #define ever (;;) - for ever { - ... + ; } ]], - [[ +[[ void *xmalloc(size_t size) { - void *ret = malloc(size); - if (!ret) - die("memory exhausted"); - return ret; + void *r = malloc(size); + if (!r) + abort(); + return r; } ]], +[[ +#include +uint32_t rotl32(uint32_t x, uint32_t n) +{ + return (x << n) | (x >> (32 - n)); +} +]], +[[ +#include +void memzero(void *p, size_t n) +{ + unsigned char *t = p; + while (n--) + *t++ = 0; +} +]], +[[ +#include +int main(void) +{ + int a = 0; + if (a++ == 0 && a++ == 1 && a++ == 2) + printf("chain ok\n"); + return 0; +} +]], +[[ +static unsigned long next = 1; +int lrand(void) +{ + next = next * 1103515245 + 12345; + return (unsigned)(next / 65536) & 32767; +} +]], + +[[ +#!/bin/sh +set -eu +printf '%s\n' "$1" +]], +[[ +#!/bin/sh +if [ "$#" -eq 0 ]; then + exit 1 +fi +printf '%s\n' "$@" +]], +[[ +#!/bin/sh +x=0 +while :; do + x=$((x + 1)) + [ "$x" -gt 3 ] && break +done +printf '%s\n' "$x" +]], +[[ +#!/bin/sh +exec 3>&1 +printf 'ok\n' >&3 +]], +[[ +#!/bin/sh +f() { + printf '%s\n' "$1" +} +f "${1:-none}" +]], +[[ +#!/bin/sh +for i in a b c; do + printf '%s\n' "$i" +done +]], +[[ +#!/bin/sh +x=$(printf '%s' foo) +printf '%s\n' "$x" +]], +[[ +#!/bin/sh +read x +printf '%s\n' "$x" +]], +[[ +#!/bin/sh +PATH=/bin:/usr/bin +export PATH +printf '%s\n' "$PATH" +]], +[[ +#!/bin/sh +trap 'printf trap\n' HUP INT TERM +sleep 1 +]] } M.daily_random = function() - local day = tonumber(os.date("%d")) - local n = #snippet - local a = 1664525 - local c = 1013904223 - local m = 2^32 - local v = (a * day + c) % m - local r = v / m - return snippet[math.floor(r * n) + 1] + local t = os.date("*t") + local seed = t.day + t.month * 31 + t.year * 997 + local a = 1103515245 + local c = 12345 + local m = 2 ^ 31 + seed = (a * seed + c) % m + local r = seed / m + local n = #snippet + return snippet[math.floor(r * n) + 1] end return M diff --git a/fsd.vxserver.dev/news/00-happy-holidays.md b/fsd.vxserver.dev/news/00-happy-holidays.md new file mode 100644 index 0000000..2d360d7 --- /dev/null +++ b/fsd.vxserver.dev/news/00-happy-holidays.md @@ -0,0 +1,7 @@ +# Happy Holidays + +Merry Christmas and Happy Holidays! + +This article mostly exists to test the article system at `news` + +2025-02-12 diff --git a/fsd.vxserver.dev/news/01-alpha-release.md b/fsd.vxserver.dev/news/01-alpha-release.md new file mode 100644 index 0000000..6bc069a --- /dev/null +++ b/fsd.vxserver.dev/news/01-alpha-release.md @@ -0,0 +1,32 @@ +# Alpha Release + +# Pages + +This is the first release of this site so far we have the following pages: + +* About +* FAQ +* Releases +* Site news + +### About + +This page contains information about fSD. + +### FAQ + +Answers common questions about fSD and things pertaining to it. + +### Releases + +A list of fSD with a short description and link to repository. + +### Site news + +A location for news about this website, fSD, etc. + +## Future + +I hope that this gets expanded and polished as to expand the usefulness to the fSD project. + +2025-02-12 diff --git a/fsd.vxserver.dev/www/about.lua b/fsd.vxserver.dev/www/about.lua index 44c0930..b7fdde2 100644 --- a/fsd.vxserver.dev/www/about.lua +++ b/fsd.vxserver.dev/www/about.lua @@ -13,7 +13,33 @@ site:banner(fes.app.header.render(std)) site:note(u.cc({ std.h2("Free Software Distributions"), - std.p("Free Software Distributions are a collection of free, minimal, and hackable packages desinged for the similar developer: someone who values freedom in software and a partition from corporation.") + std.p([[ + The Free Software Distributions, stylized as fSD, Project is a collection of +free, minimal, and hackable packages for the similar developer: a person who +desires freedom in their tooling and a the ability to easily continue their +industry. Packages from fSD are built with a philosphy driven devlopment as +their core, this process of a strong idealical foundtion makes for consistant, +good, and dogmatic software. +]]), + std.p([[ + Our philosphy has three core points: freedom, minimalism, and hackabliting: +]]), + std.ul({ + std.p(std.highlight("freedom: ") .. "the ability to see, touch, and smell our source code."), + std.p(std.highlight("minimalism: ") .. ""), + std.p(std.highlight("hackability: ") .. "packages should be easy to modify beyond their open-sourceness."), + }), + std.p([[ + These core points help derive awesome software ( at least I think so ) and keep a unified focus from other developers whilst they contribute. +]]), + std.br(), + std.blockquote([[ +Most of the good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program. - Linus Torvalds +]]), + std.br(), + std.p([[ + We hope that you enjoy our software and gain somethin from our time here. +]]) })) site:note(u.cc({ std.h2("Copyright and License"), diff --git a/fsd.vxserver.dev/www/news.lua b/fsd.vxserver.dev/www/news.lua index 75e4540..b655279 100644 --- a/fsd.vxserver.dev/www/news.lua +++ b/fsd.vxserver.dev/www/news.lua @@ -7,55 +7,100 @@ local site = fes.fes() local title = "Free Software Distributions" site.title = title .. " - Site news" -site.copyright = u.copyright("https://git.vxserver.dev/fSD", "fSD") - +site.copyright = u.copyright("[https://git.vxserver.dev/fSD](https://git.vxserver.dev/fSD)", "fSD") site:banner(fes.app.header.render(std)) -local articles_dir = "article" +local function url_encode(s) +if not s then return "" end +s = s:gsub("([^%w%-_.~])", function(c) return string.format("%%%02X", string.byte(c)) end) +return s +end + +local function list_files_in_dir(dir) local files = {} - -local p = io.popen("ls -1 " .. articles_dir) -if p then - for file in p:lines() do - if file:match("%.md$") then - files[#files + 1] = file - end - end - p:close() +local ok, lfs = pcall(require, "lfs") +if ok and lfs then +for name in lfs.dir(dir) do +if name ~= "." and name ~= ".." then +local attr = lfs.attributes(dir .. "/" .. name) +if attr and attr.mode == "file" then +table.insert(files, name) +end +end +end +table.sort(files) +return files +end +local p = io.popen('ls -1 "' .. dir:gsub('"','\"') .. '" 2>/dev/null') +if not p then return files end +for line in p:lines() do +if line ~= "." and line ~= ".." then +local f = dir .. "/" .. line +local fh = io.open(f, "r") +if fh then +fh:close() +table.insert(files, line) +end +end +end +p:close() +table.sort(files) +return files end -table.sort(files, function(a, b) return a > b end) - -local news_html = {} -local news_titles = {} - -for _, file in ipairs(files) do - local path = articles_dir .. "/" .. file - local f = io.open(path, "r") - if f then - local content = f:read("*a") - f:close() - news_html[#news_html + 1] = fes.markdown_to_html(content) - local title_line = content:match("^#+%s*(.-)%s*\n") or "" - news_titles[#news_titles + 1] = std.h3(title_line) - end +local function read_file(path) +local f = io.open(path, "r") +if not f then return nil end +local data = f:read("*a") +f:close() +return data end -site:note(u.cc({ - std.h1("Site news - Latest"), - std.blockquote(std.p(news_html[1] or "")), -})) +local dir = "news" +local files = list_files_in_dir(dir) -local other_titles = {} - -for i = 2, #news_titles do - other_titles[#other_titles + 1] = news_titles[i] +local params = fes.bus.params or {} +local article = params.article +if type(article) == "table" then +article = article[1] end -site:note(u.cc({ - std.center(std.h2("Other")), - table.concat(other_titles, "") -})) +if article then +local candidates = {article, article .. ".txt", article .. ".md", article .. ".html"} +local body +for _, c in ipairs(candidates) do +local p = dir .. "/" .. c +body = read_file(p) +if body then break end +end +site.title = article +if body then +site:custom(fes.markdown_to_html(body)) +else +site:note(u.cc { + std.h1(article), + std.p("article not found"), +}) +end +site:note(fes.app.footer.render(std)) +return site +end + +local articles = {} +local n = 0 +for _, v in ipairs(files) do +local display = v:gsub("%.[^%.]+$", "") +local link = "/news?article=" .. url_encode(display) +table.insert(articles, std.a(link, display)) +n = n + 1 +end + +if n > 0 then +site:h1("Site news") +site:note(std.ul(articles)) +else +site:h1("No articles") +end site:note(fes.app.footer.render(std)) diff --git a/fsd.vxserver.dev/www/release.lua b/fsd.vxserver.dev/www/release.lua index adeb762..61e11e9 100644 --- a/fsd.vxserver.dev/www/release.lua +++ b/fsd.vxserver.dev/www/release.lua @@ -1,25 +1,34 @@ local fes = require("fes") local std = fes.std -local u = fes.util +local u = fes.util local site = fes.fes() local title = "Free Software Distributions" -site.title = title .. "- FAQ" +site.title = title .. " - Release" site.copyright = u.copyright("https://git.vxserver.dev/fSD", "fSD") site:banner(fes.app.header.render(std)) -site:note(u.cc({ - std.h1("Frequently Asked Questions"), - std.p("Welcome to the world of fSD, come here ye before thou ask thy stupid questions."), - std.h2("Why is it called fSD?"), - std.p([[ - The name "Free Software Distributions" is dervided from exactly what we do, we distribute free software. - This name stems from the Berkeley Software Distribution (BSD) specifically the Software Distribution part. - ]]), - std.p('It is worth pointing out that the word "free" is being used in two ways here: one meaning "at no cost" and the other meaning "do whatever you like".'), +local pkgs = { + { "yait", "Highly opinionated C and SH project generator." }, + { "fes", "A lightweight, static, and opinionated microframework." }, +} + +for i, pkg in pairs(pkgs) do + pkgs[i] = std.note(u.cc({ + std.h2(pkg[1]), + std.muted(pkg[2] or "Could not find a description."), + std.br(), + std.ul({ + std.rl(pkg[1], std.external("https://git.vxserver.dev/fSD/" .. pkg[1], "Download")), + }), + })) +end + +site:custom(u.cc({ + u.cc(pkgs), })) site:note(fes.app.footer.render(std))