From eee9d34b4da47bf355c86a0e3819fa0be4515c1e Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 15 Jun 2022 10:28:56 -0500 Subject: Add posts mostly --- asset/casa.css | 27 ++++-- ht.awk | 176 +++++++++++++++++++++++--------------- ht3.awk | 56 +++++++++--- src/books-to-read--sff-edition.ht | 20 +++++ src/it-works-on-my-machine.ht | 18 ++++ src/one-more-thing.ht | 12 +++ src/wweekend.ht | 14 +++ 7 files changed, 234 insertions(+), 89 deletions(-) create mode 100644 src/books-to-read--sff-edition.ht create mode 100644 src/it-works-on-my-machine.ht create mode 100644 src/one-more-thing.ht create mode 100644 src/wweekend.ht diff --git a/asset/casa.css b/asset/casa.css index b607bf1..ad803be 100644 --- a/asset/casa.css +++ b/asset/casa.css @@ -1,9 +1,6 @@ html { min-height: 100vh; margin:0; padding: 0; -} - -html { font: 18px serif; } @@ -22,15 +19,21 @@ main { background: #405990; } -a { - color: yellow; -} - footer { text-align: right; padding: 1ch 0; } +@media screen and (max-width: 700px) { + body { padding: 0; } + main,footer { padding: 1ch; } + h1 { padding: 0 1ch; } +} + +a { + color: yellow; +} + #back { float: left; } @@ -38,3 +41,13 @@ footer { code { color: #c0ffee; } + +blockquote { position: relative; } + +blockquote::before { + content: "“"; + font-size: 2em; + position: absolute; + left: -1em; + top: -0.25em; +} diff --git a/ht.awk b/ht.awk index a382ae7..9288060 100755 --- a/ht.awk +++ b/ht.awk @@ -3,96 +3,136 @@ # (C) 2022 C. Duckworth # ht.awk converts mostly-html (with some conveniences) to actual html - -function bufpush(s) { - BUF = BUF (BUF ? "\n" : "") s; +/^;/ { + sub(/^;/, "", $0) + print "" + next } -function buflush() { - if (BUF) print BUF; - BUF = ""; - if (tag && (tag != "html") && (tag != "raw")) - print ""; +/^/, "\\>", t); - sub(/^ /, "\\ ", t); - return t; +/^```$/ { # Raw block + if (! (tag == "raw")) { + tag = "raw" + getline + bufpush("
" $0)
+	} else {
+		bufpush("
") + buflush() + tag = "" + } + next } -/^;/ { sub(/^;/,""); print ""; next; } +/^=>/ { # Links (Gemini-style) + if (tag == "raw") { + next + } + link = "" $3 + for (i = 4; i <= NF; i++) { + link = link " " $i + } + link = link "" + bufpush(link) + next +} -/^", $0) } -/^```$/ { # Raw block - if (! (tag == "raw")) { - tag = "raw"; - getline; - bufpush("
" $0);
-    } else {
-        bufpush("
"); - buflush(); - tag = ""; - } - next; +/^[0-9]+\./ { # Ordered lists + if (tag == "raw") { + next + } + if (! (tag == "ol")) { + tag = "ol" + } + sub(/^[0-9]+\.[ \t]/, "
  • ", $0) } -/^=>/ { # Links (Gemini-style) - if (tag == "raw") next; - link = "" $3; - for (i=4;i<=NF;i++) link = link " " $i; - link = link ""; - bufpush(link); - next; +/^>/ { # Blockquotes + if (tag == "raw") { + next + } + if (! (tag == "blockquote")) { + tag = "blockquote" + } + sub(/^>[ \t]*/, "", $0) } -/^-/ { # Unordered lists - if (tag == "raw") next; - if (! (tag == "ul")) tag = "ul"; - sub(/^-[ \t]*/, "
  • "); +/^#+/ { # Headers + if (tag == "raw") { + next + } + match($0, /^#+/) + if (! (tag == "h" RLENGTH)) { + buflush() + tag = "h" RLENGTH + } + sub(/^#+[ \t]*/, "", $0) } -/^[0-9]+\./ { # Ordered lists - if (tag == "raw") next; - if (! (tag == "ol")) tag = "ol"; - sub(/^[0-9]+\.[ \t]/, "
  • "); +/^$/ { + if (tag == "raw") { + next + } + buflush() + tag = "" } -/^>/ { # Blockquotes - if (tag == "raw") next; - if (! (tag == "blockquote")) tag = "blockquote"; - sub(/^>[ \t]*/,""); +/./ { + if (! tag) { + tag = "p" + } + if (! BUF) { + bufpush("<" tag ">") + } + if (tag == "raw") { + $0 = esc($0) + } + bufpush($0) } -/^#+/ { # Headers - if (tag == "raw") next; - match($0, /^#+/); - if (! (tag == "h" RLENGTH)) { - buflush(); - tag = "h" RLENGTH; - } - sub(/^#+[ \t]*/,""); +END { + buflush() } -/^$/ { - if (tag == "raw") next; - buflush(); - tag = ""; + +function buflush() +{ + if (BUF) { + print BUF + } + BUF = "" + if (tag && (tag != "html") && (tag != "raw")) { + print "" + } } -/./ { - if (! tag) tag = "p"; - if (! BUF) bufpush("<" tag ">"); - if (tag == "raw") $0 = esc($0); - bufpush($0); +function bufpush(s) +{ + BUF = BUF (BUF ? "\n" : "") s } -END { buflush(); } +function esc(t) +{ + # This is of much more limited utility than I initially realized. + gsub(/&/, "\\&", t) + gsub(//, "\\>", t) + sub(/^ /, "\\ ", t) + return t +} diff --git a/ht3.awk b/ht3.awk index 996cb1a..5226af7 100755 --- a/ht3.awk +++ b/ht3.awk @@ -15,45 +15,71 @@ BEGIN { } # Output buffer. The output will be chunked into blocks. BUFFER = "" + # Default block type + DEFAULT_BLOCK = "p" # The current block type. We start with a standard paragraph. - BLOCK = "p" + BLOCK = DEFAULT_BLOCK } ### RAW TEXT /^>>>/ { + BLOCK = "raw" + if ($1) { + split($1, raw_type, ",") + } } /^<</ { # Block quote +/^>/ { # Block quote } -/^-/ { # Unordered list +/^-/ { # Unordered list } -/^[0-9]\./ { # Ordered list +/^[0-9]\./ { # Ordered list } -/^---$/ { # Section break +/^---$/ { # Section break +} + +/^$/ { # End a block + buflush() + BLOCK = DEFAULT_BLOCK } ### LINES -/^=>/ { # Link +/^=>/ { # Link } -/^ https://www.nytimes.com/2022/05/27/books/review/new-science-fiction-fantasy.html the New York Times +but they like to shut off access to their articles, so I'm repeating the list here. + +- And Then I Woke Up -- Malcolm Devlin +- Hell Followed with Us -- Joseph White +- Her Majesty's Royal Coven -- Juno Dawson +- Kaikeyi -- Vaishnavi Patel +- In a Garden Burning Gold -- Rory Power +- The Stardust Thief -- Chelsea Abdullah + +In order to not steal +too much +from the venerable Times, +I've only listed the books here. +Subscribe, I guess, for the reviews themselves. \ No newline at end of file diff --git a/src/it-works-on-my-machine.ht b/src/it-works-on-my-machine.ht new file mode 100644 index 0000000..60fc227 --- /dev/null +++ b/src/it-works-on-my-machine.ht @@ -0,0 +1,18 @@ +;@@title: it works on my machine@@ +;@@date: 2022-06-09@@ + +I keep seeing things that I wish there were comprehensive tutorials for +– I'm thinking, now, of +gpg +and +tramp +– but I realize that really, all computer problems break down to that dreaded phrase: + +> Well, it works on my machine. + +Computers are great big balls of state, aren't they? That's why rebooting fixes so many problems. I guess you could say life is a great big ball of state, though we can't reboot it easily. + +Anyway, this is all to say that things are complicated, I suppose. +And while it'd be nice to have simpler things, I think that trying too hard to simplify actually creates more problems than it's worth (see +=> https://applied-langua.ge/posts/here-is-a-loud-announcement.html Applied Language +for other ideas). diff --git a/src/one-more-thing.ht b/src/one-more-thing.ht new file mode 100644 index 0000000..869ea0d --- /dev/null +++ b/src/one-more-thing.ht @@ -0,0 +1,12 @@ +;@@title: one more thing@@ +;@@date: 2022-06-06@@ + +i really need to figure out how to separate my content from my engine here. + +i just spent about 5 white-knuckle minutes trying to rebase my feature branch +(ooh, ahh!) +to not include the new posts I'm making. i'll have to do it again because i'm going +to forget to switch branches before writing another one. i guess at least now i know +i know how to rebase, so + +anyway, ideas welcome. email the guy in the last post ("moved in"). diff --git a/src/wweekend.ht b/src/wweekend.ht new file mode 100644 index 0000000..97652ed --- /dev/null +++ b/src/wweekend.ht @@ -0,0 +1,14 @@ +;@@title: wweekend@@ +;@@date: 2022-06-13@@ + +Saw the WWE this weekend ... for +free, +as a seat filler! (ssh, don't tell anyone that the WWE fills seats.) + +It was an absolute blast, let me tell you. We lucked out in that we ended up filling seats that the ticket buyers never showed up for, so we just had great seats for free. Not sure how much they cost, but I figure at least over $100. + +Saturday we had a house-warming party which was also great, just good fun with friends. and we got to show off our new house, which is truly wonderful! + +now i'm at work which is... work, lol. i've actually got nothing to do +right now +which is why i'm writing this blog. i feel like, this is maybe not the best way to write this blog thing, whatever it is. hm. -- cgit 1.4.1-21-gabe81