update the readme so it's not lying
This commit is contained in:
parent
1d300aa6bb
commit
773621f610
2 changed files with 48 additions and 58 deletions
97
README
97
README
|
@ -1,6 +1,6 @@
|
|||
|
||||
--------------
|
||||
| λ.sorrel.dev |\
|
||||
| λ sorrel.dev |\
|
||||
\--------------\ \
|
||||
\______________\|
|
||||
|
||||
|
@ -21,14 +21,18 @@ so
|
|||
|----------------|
|
||||
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
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.
|
||||
i write my little posts in xml-like s-expressions. (not for everyone! but i like the
|
||||
expressivity!) someday, i might turn it into a proper dsl with support for htmx's
|
||||
~funky~ syntax and a little more distance from it's host language, but not this day.
|
||||
|
||||
i make generous use of `racket/web-server` with a dispatcher for `hx/` prefixed content
|
||||
(snippets of html), and plain `/` (for rendering full pages.) handlers build the
|
||||
content from the little sexpr .txt files (they're not valid racket on they're own,
|
||||
they get read and evaluated as data.) it's all real small and everything, but i figured
|
||||
why not save the generated html in a `static/` directory so it doesn't need to be built
|
||||
on each request? so that's what happens.
|
||||
|
||||
that's the server! it's compiled and hosted on bunk.computer. it's all very cute.
|
||||
|
||||
_________________
|
||||
|-----------------|
|
||||
|
@ -46,15 +50,16 @@ right now, the plan's for
|
|||
|
||||
~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.
|
||||
home for everything that's done enough to need a home. or projects with
|
||||
"minimally kickable tires"
|
||||
|
||||
~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
|
||||
~THOUGHTS ABOUT THOUGHTS?~
|
||||
there's some "root" resources. yr typical about page, y'know with some
|
||||
biographical information, or whatever. "errata" like:
|
||||
~a page about the site itself.
|
||||
~maybe a link page with some links to things i like or do as a person with other people
|
||||
in the world
|
||||
~a tag index and indices for tags
|
||||
|
||||
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
|
||||
|
@ -70,43 +75,35 @@ 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.
|
||||
let's talk about the posting. so you write up a little bit of s-expressified xml-like
|
||||
plain text works of astounding eloquence; how do you get the server to generate some
|
||||
stuff for you? i wrote a little utility for that. it's called "publish" and it uses a
|
||||
#lang package a friend made for making cli tools called
|
||||
[cli](https://docs.racket-lang.org/cli/index.html)
|
||||
|
||||
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:
|
||||
the tool is called "publish" and it needs some flags to build a thing right.
|
||||
```
|
||||
$ mkpost -s source/source-file.txt -t public_html/blog/target-file.html
|
||||
$ publish -i in-progress/ex.txt \ # -i is for the input (i keep em in in-progress/")
|
||||
-r unsettled \ # -r is for the resource "type" (see "WHAT'S ON THERE?")
|
||||
-t ecology,art,computer \ # -t is for comma separated tags
|
||||
-l "An Example Text" \ # -l is for head_l_ine (it means title)
|
||||
-d "a short description-like a sentence long ideally"
|
||||
# there's also an "-x" flag to do a "test run" before publishing. it'll generate
|
||||
# stuff in publish-test/ including a "staging database" (it's csv files)
|
||||
```
|
||||
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}
|
||||
there's a couple things this'll do.
|
||||
- first it'll take yr post and do some processing, add a footer with metadata and tags.
|
||||
- it'll also update the "database" of csv files for the resource type and for all of
|
||||
the associated tags.
|
||||
- this generates new index files for the resource type, and the tags.
|
||||
- if the post introduces a new tag, a new tag index gets made.
|
||||
- the atom feed gets updated with the uri and the relevant info about the post.
|
||||
(it's on the to-do list to embed the post in the feed, cause i like to read my rss
|
||||
in cli, but i'm also a hypocrite that wants people to visit my page!)
|
||||
- finally it moves the input file to an archive folder.
|
||||
(in the future i'll make an update tool for posting updates to existing stuff!)
|
||||
|
||||
so that's simple enough.
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -365,11 +365,4 @@
|
|||
|
||||
(displayln "publish was successful")))
|
||||
|
||||
;;; (run publish)
|
||||
|
||||
(run publish #("-i" "in-progress/beginning-latl.txt"
|
||||
"-r" "unsettled"
|
||||
"-t" "latl,conlang"
|
||||
"-l" "Beginning LATL"
|
||||
"-d" "beginning the process of thinking through an environment for conlanging and other language shenanigans"
|
||||
"-x"))
|
||||
(run publish)
|
||||
|
|
Loading…
Reference in a new issue