oxaliq.net/README
2023-10-30 16:42:28 -04:00

112 lines
4.1 KiB
Text

--------------
| λ.sorrel.dev |\
\--------------\ \
\______________\|
it's my personal home page.
it's for putting stuff on the web.
it's written in racket and serves (mostly) static html pages. there's some little
javascript in there - https://htmx.org/
why's there some javascript? because javascript is still kinda important to me??
mostly cause i think this htmx project is neat and allows me to do some cool things
without sending several megabytes. and the pages still work without allowing scripts.
so
________________
|----------------|
| HOW IT'S BUILT |
|----------------|
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
it's a racket web server that uses xml library to generate some valid html.
there's a dirty little dsl in there so that i can type some plain texty stuff and
have my plain texty stuff get turned into sexprs and then into xexprs and then written
as new-fangled html. typical lispy stuff.
```
(require web-server ; like so much of this module
xml)
```
that's all compiled and hosted in my friend maren's bedroom. it's all very cute.
_________________
|-----------------|
| WHAT'S ON THERE |
|-----------------|
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
so, yea, it's all running over there and it's serving up some html (with a little dash
of javascript.) so what's on it?
right now, the plan's for
~UNSETTLED THOUGHTS~
it's like a blog. just thinking out loud. or talking about projects that aren't
ready to get their "tires kicked" yet
~SETTLED THOUGHTS~
it's like a portfolio. links to stuff. deployed stuff. pictures of stuff. a
home for everything that's done enough to need a home.
~THOUGHTS ABOUT WHO EVEN AM I~
yr typical about page, y'know with some biographical information, some
musings about life's meaning. some links to things i like or do as a
person with other people in the world.
~some kinda tag system for things
~some kinda apology for even serving you some javascript
the structure of things is such that: there's no templating per se. if the request
has the path prefix "/hx/" you just get little snippets of html. the htmx is there to
stitch that stuff together. make sure yr browser insesrts the response where it
belongs in the page and i wipe my hands of the the thing. otherwise you get a page
stitched together from all the bits and bobs.
so don't be surprised if yr response is just an ~unsettled thought~ without any header
or footer or any of that fanciness.
_____________
|-------------|
| HOW TO POST |
|-------------|
¯¯¯¯¯¯¯¯¯¯¯¯¯
remember up at the top of the README i said there was a DSL for this thing? i meant a
domain specific language. the domain is hella specific. like just my particular web
page specific. there's little grammars for each little part of it. i'll talk about
those in a moment.
for right now i'm going to talk about the posting. so you write up a little bit of
plain text according to the grammar for the type of post yr going to do. how do you get
the server to generate some stuff for you? that's where the second part of the process
comes in. there's a little racket utility for that. if it were an ~unsettled thought~
for example it might look something like:
```
$ mkpost -s source/source-file.txt -t public_html/blog/target-file.html
```
there's a couple things this'll do. the most obvious is that it takes yr plain text
and it generates some html. you expected that. the other thing it does is it writes
the name of that file to a little lookup table with all it's tags. [i haven't
implemented this part yet]
so that's simple enough. now for the
__________________________
|--------------------------|
| DOMAIN SPECIFIC LANGUAGE |
|--------------------------|
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
the main pages are just handwritten xexprs. not worth spending time on something you'll
only write once.
but for the posts:
post = post type, tags
post type = ( "blog" | "project" ) "\n" ;
tags = { tag identifier, white space } "\n" ;
tag identifier = "#", { alphabetic character}