From 4982e32350a2232e07032f91a42740f7ffc7e2d4 Mon Sep 17 00:00:00 2001 From: sorrel Date: Sun, 21 Jan 2024 17:56:40 -0500 Subject: [PATCH] change .txt to .scm in source files allows git forge to recognize source as sexprs --- .dev-log | 12 ++++++++ .idea-log | 14 +++++++++- archive/{about.txt => about.scm} | 0 ...{beginning-latl.txt => beginning-latl.scm} | 0 archive/{contact.txt => contact.scm} | 0 archive/{now.txt => now.scm} | 0 archive/{this.txt => this.scm} | 0 ...laimer.txt => very-earnest-disclaimer.scm} | 0 data/{make-atom.txt => make-atom.scm} | 0 in-progress/{links.txt => links.scm} | 0 modify.rkt | 14 +++++----- oxaliq.net.rkt | 14 +++++----- publish.rkt | 28 +++++++++---------- source/{about.txt => about.scm} | 0 source/{contact.txt => contact.scm} | 0 source/{head.txt => head.scm} | 0 source/{header.txt => header.scm} | 0 source/{index.txt => index.scm} | 0 source/{make-index.txt => make-index.scm} | 0 source/{not-found.txt => not-found.scm} | 0 source/{now.txt => now.scm} | 0 source/{post-footer.txt => post-footer.scm} | 0 source/settled/{index.txt => index.scm} | 0 source/tagged/{about.txt => about.scm} | 0 source/tagged/{conlang.txt => conlang.scm} | 0 source/tagged/{index.txt => index.scm} | 0 source/tagged/{latl.txt => latl.scm} | 0 ...-language.txt => programming-language.scm} | 0 source/{this.txt => this.scm} | 0 source/unsettled/{1.txt => 1.scm} | 0 source/unsettled/{index.txt => index.scm} | 0 ...laimer.txt => very-earnest-disclaimer.scm} | 0 32 files changed, 53 insertions(+), 29 deletions(-) rename archive/{about.txt => about.scm} (100%) rename archive/{beginning-latl.txt => beginning-latl.scm} (100%) rename archive/{contact.txt => contact.scm} (100%) rename archive/{now.txt => now.scm} (100%) rename archive/{this.txt => this.scm} (100%) rename archive/{very-earnest-disclaimer.txt => very-earnest-disclaimer.scm} (100%) rename data/{make-atom.txt => make-atom.scm} (100%) rename in-progress/{links.txt => links.scm} (100%) rename source/{about.txt => about.scm} (100%) rename source/{contact.txt => contact.scm} (100%) rename source/{head.txt => head.scm} (100%) rename source/{header.txt => header.scm} (100%) rename source/{index.txt => index.scm} (100%) rename source/{make-index.txt => make-index.scm} (100%) rename source/{not-found.txt => not-found.scm} (100%) rename source/{now.txt => now.scm} (100%) rename source/{post-footer.txt => post-footer.scm} (100%) rename source/settled/{index.txt => index.scm} (100%) rename source/tagged/{about.txt => about.scm} (100%) rename source/tagged/{conlang.txt => conlang.scm} (100%) rename source/tagged/{index.txt => index.scm} (100%) rename source/tagged/{latl.txt => latl.scm} (100%) rename source/tagged/{programming-language.txt => programming-language.scm} (100%) rename source/{this.txt => this.scm} (100%) rename source/unsettled/{1.txt => 1.scm} (100%) rename source/unsettled/{index.txt => index.scm} (100%) rename source/{very-earnest-disclaimer.txt => very-earnest-disclaimer.scm} (100%) diff --git a/.dev-log b/.dev-log index 348bd47..af69bcd 100644 --- a/.dev-log +++ b/.dev-log @@ -1,3 +1,15 @@ +2024/01/21 + - .txt -> .scm for better source viewing in git forge +START HERE: + - pick a license + - fix footer styling (tagged section is cramped with flex-row + especially on mobile) + - add view source link to every page (git forge of source/resource + not static/resource; we're here for the sexprs) +TODO: + - refactor publish script for atomic, idempotent execution (follow + rollback thunk + compose accumulator pattern in modify script) + 2024/01/17 - add html cache directories to build script TODO: diff --git a/.idea-log b/.idea-log index 27b9281..214838f 100644 --- a/.idea-log +++ b/.idea-log @@ -1,4 +1,16 @@ -21/12/2023 +2023/01/19 +- published about posts linked from index page +- published beginning-latl +- in-progress + - links ? +- to write next + - conlanging-tools + - fca (latl first attempt) + - latl-primitives + - syntax-considered-harmful ? (playful) + - (l)ddd (living)-documentation-driven-development ? (playful) + +2023/12/21 - beginning latl effectively finished and ready for post once ci is fixed - projects to write about - input-messenger diff --git a/archive/about.txt b/archive/about.scm similarity index 100% rename from archive/about.txt rename to archive/about.scm diff --git a/archive/beginning-latl.txt b/archive/beginning-latl.scm similarity index 100% rename from archive/beginning-latl.txt rename to archive/beginning-latl.scm diff --git a/archive/contact.txt b/archive/contact.scm similarity index 100% rename from archive/contact.txt rename to archive/contact.scm diff --git a/archive/now.txt b/archive/now.scm similarity index 100% rename from archive/now.txt rename to archive/now.scm diff --git a/archive/this.txt b/archive/this.scm similarity index 100% rename from archive/this.txt rename to archive/this.scm diff --git a/archive/very-earnest-disclaimer.txt b/archive/very-earnest-disclaimer.scm similarity index 100% rename from archive/very-earnest-disclaimer.txt rename to archive/very-earnest-disclaimer.scm diff --git a/data/make-atom.txt b/data/make-atom.scm similarity index 100% rename from data/make-atom.txt rename to data/make-atom.scm diff --git a/in-progress/links.txt b/in-progress/links.scm similarity index 100% rename from in-progress/links.txt rename to in-progress/links.scm diff --git a/modify.rkt b/modify.rkt index 16235c9..22e2d28 100644 --- a/modify.rkt +++ b/modify.rkt @@ -23,12 +23,12 @@ ;; this will not! (for now) update the /index or tagged//index pages ! ;; (these pages do not currently show post history) -;; - update the atom.txt feed +;; - update the atom table and rebuild the atom feed ;; example -;; modify -input-file in-progress/beginning-latl.txt --resource-type unsettled +;; modify -input-file in-progress/beginning-latl.scm --resource-type unsettled ;; --headline "Beginning LATL" -;; publish -i in-progress/beginning-latl.txt -r unsettled -l "Beginning LATL" +;; publish -i in-progress/beginning-latl.scm -r unsettled -l "Beginning LATL" (help (usage "modify is here to update existing posts with new content.")) @@ -87,7 +87,7 @@ (if x-test (build-path "publish-test" "source" r-type l-head) (build-path "source" r-type l-head))) - #".txt")]) + #".scm")]) (values (open-input-file file-handle) (open-output-file file-handle #:exists 'update)))) @@ -128,14 +128,14 @@ (open-input-file file-handle) (open-output-file file-handle #:exists 'update)))) - ;; get make-atom.txt input-port + ;; get make-atom.scm input-port ;; (. -> . input-port?) (define (get-make-atom-input-port) (let ([file-handle (path-add-extension (if x-test (build-path "publish-test" "data" "make-atom") (build-path "data" "make-atom")) - #".txt")]) + #".scm")]) (open-input-file file-handle))) @@ -249,7 +249,7 @@ ;; replace resource in source//id (define (append-post-footer post-xexpr tag-list history-list) (let ([post-footer - (read (open-input-file "source/post-footer.txt"))]) + (read (open-input-file "source/post-footer.scm"))]) `(body ,post-xexpr ,((eval post-footer ns) tag-list history-list)))) diff --git a/oxaliq.net.rkt b/oxaliq.net.rkt index 93c5b51..d9008a4 100644 --- a/oxaliq.net.rkt +++ b/oxaliq.net.rkt @@ -32,7 +32,7 @@ (list content))) ;; bound path builders -;; extension is always #".txt" because source files are not well-formed racket, +;; extension is always #".scm" because source files are not racket, ;; but must be read and evaluated in this namespace (define (make-path-no-param root-folder extension) (lambda (t) @@ -62,10 +62,10 @@ extension))) (define (make-source-path-no-param t) - ((make-path-no-param "source" #".txt") t)) + ((make-path-no-param "source" #".scm") t)) (define (make-source-path-id-param t id) - ((make-path-id-param "source" #".txt") t id)) + ((make-path-id-param "source" #".scm") t id)) (define (make-static-path-no-param api-type t) (let ([root-folder @@ -156,7 +156,7 @@ (html-response (if (file-exists? static-path) (static-file-res static-path) - (xexpr-file->res "source/not-found.txt" (write-static-file static-path)))))) + (xexpr-file->res "source/not-found.scm" (write-static-file static-path)))))) (define-values (httpx-app reverse-httpx-uri) @@ -181,9 +181,9 @@ (define (fragment->page resource) (xexpr->string `(html ((lang "en")) - ,(read (open-input-file "source/head.txt")) + ,(read (open-input-file "source/head.scm")) (body - ,(read (open-input-file "source/header.txt")) + ,(read (open-input-file "source/header.scm")) (main ,(read (open-input-file resource))))))) (define (404-page) @@ -191,7 +191,7 @@ (html-response (if (file-exists? static-path) (static-file-res static-path) - (make-page "source/not-found.txt" (write-static-file static-path)))))) + (make-page "source/not-found.scm" (write-static-file static-path)))))) (define-values (page-app reverse-page-uri) (dispatch-rules diff --git a/publish.rkt b/publish.rkt index b641a3d..8eef83b 100644 --- a/publish.rkt +++ b/publish.rkt @@ -20,15 +20,15 @@ ;; - update a read-table for resource type -;; - update the atom.txt feed +;; - update the atom feed ;; - move the original input file ;; example -;; publish -input-file in-progress/beginning-latl.txt --resource-type unsettled --tags latl,conlang \ +;; publish -input-file in-progress/beginning-latl..scm --resource-type unsettled --tags latl,conlang \ ;; --headline "Beginning LATL" --description "beginning the process of thinking through an environment \ ;; for conlanging and other language shenanigans" -;; publish -i in-progress/beginning-latl.txt -r unsettled -t latl,conlang -l "Beginning LATL" \ +;; publish -i in-progress/beginning-latl.scm -r unsettled -t latl,conlang -l "Beginning LATL" \ ;; -d "beginning the process of thinking through an environment for conlanging and other language shenanigans" (help (usage "Publish is here to put yr posts together.")) @@ -75,7 +75,7 @@ (define (append-post-footer post-xexpr tag-list history-list) (let ([post-footer - (read (open-input-file "source/post-footer.txt"))]) + (read (open-input-file "source/post-footer.scm"))]) `(body ,post-xexpr ,((eval post-footer ns) tag-list history-list)))) @@ -85,12 +85,12 @@ (if (non-empty-string? l) (path->string (path-add-extension (build-path (if x "publish-test/source" "source") (string-replace l " " "-")) - ".txt")) + ".scm")) (error "'root resource requires headline"))) (define (make-res-file-handle x r id) (if (< 0 id) (path->string (path-add-extension (build-path (if x "publish-test/source" "source") r (~a id)) - ".txt")) + ".scm")) (error "~a resource requires r-id" r))) (if (equal? r-type "root") (make-root-file-handle x-test l-headline) @@ -100,12 +100,12 @@ (displayln "write-new-tagged/index") (let* ([tags (rest (map (lambda (row) (first row)) tag-table))] - [make-index (read (open-input-file "source/make-index.txt"))] + [make-index (read (open-input-file "source/make-index.scm"))] [new-index ((eval make-index ns) "tagged" tags)] [handle (path-add-extension (if x (build-path "publish-test" "source" "tagged" "index") (build-path "source" "tagged" "index")) - ".txt")] + ".scm")] [file (open-output-file handle #:exists 'replace)]) (if (port-try-file-lock? file 'exclusive) (begin @@ -147,12 +147,12 @@ (hash-ref post-lookup lookup/id) (get-post-data lookup/id resources post-lookup x))) (filter non-empty-string? (rest tag-table-row)))] - [make-index (read (open-input-file "source/make-index.txt"))] + [make-index (read (open-input-file "source/make-index.scm"))] [new-index ((eval make-index ns) (~a "tagged/" tag) posts)] [handle (path-add-extension (if x (build-path "publish-test" "source" "tagged" (first tag-table-row)) (build-path "source" "tagged" tag)) - #".txt")] + #".scm")] [file (open-output-file handle #:exists 'replace)]) (if (port-try-file-lock? file 'exclusive) (begin @@ -164,12 +164,12 @@ (define (write-new-resource/index resource resource-table #:test [x #f]) (displayln "write-new-resource/index") - (let* ([make-index (read (open-input-file "source/make-index.txt"))] + (let* ([make-index (read (open-input-file "source/make-index.scm"))] [new-index ((eval make-index ns) resource (rest resource-table))] [handle (path-add-extension (if x (build-path "publish-test" "source" resource "index") (build-path "source" resource "index")) - #".txt")] + #".scm")] [file (open-output-file handle #:exists 'replace)]) (if (port-try-file-lock? file 'exclusive) (begin @@ -327,8 +327,8 @@ (display (make-feed ns (open-input-file (if x - "publish-test/data/make-atom.txt" - "data/make-atom.txt")) + "publish-test/data/make-atom.scm" + "data/make-atom.scm")) new-atom-table publish-time) feed-out) diff --git a/source/about.txt b/source/about.scm similarity index 100% rename from source/about.txt rename to source/about.scm diff --git a/source/contact.txt b/source/contact.scm similarity index 100% rename from source/contact.txt rename to source/contact.scm diff --git a/source/head.txt b/source/head.scm similarity index 100% rename from source/head.txt rename to source/head.scm diff --git a/source/header.txt b/source/header.scm similarity index 100% rename from source/header.txt rename to source/header.scm diff --git a/source/index.txt b/source/index.scm similarity index 100% rename from source/index.txt rename to source/index.scm diff --git a/source/make-index.txt b/source/make-index.scm similarity index 100% rename from source/make-index.txt rename to source/make-index.scm diff --git a/source/not-found.txt b/source/not-found.scm similarity index 100% rename from source/not-found.txt rename to source/not-found.scm diff --git a/source/now.txt b/source/now.scm similarity index 100% rename from source/now.txt rename to source/now.scm diff --git a/source/post-footer.txt b/source/post-footer.scm similarity index 100% rename from source/post-footer.txt rename to source/post-footer.scm diff --git a/source/settled/index.txt b/source/settled/index.scm similarity index 100% rename from source/settled/index.txt rename to source/settled/index.scm diff --git a/source/tagged/about.txt b/source/tagged/about.scm similarity index 100% rename from source/tagged/about.txt rename to source/tagged/about.scm diff --git a/source/tagged/conlang.txt b/source/tagged/conlang.scm similarity index 100% rename from source/tagged/conlang.txt rename to source/tagged/conlang.scm diff --git a/source/tagged/index.txt b/source/tagged/index.scm similarity index 100% rename from source/tagged/index.txt rename to source/tagged/index.scm diff --git a/source/tagged/latl.txt b/source/tagged/latl.scm similarity index 100% rename from source/tagged/latl.txt rename to source/tagged/latl.scm diff --git a/source/tagged/programming-language.txt b/source/tagged/programming-language.scm similarity index 100% rename from source/tagged/programming-language.txt rename to source/tagged/programming-language.scm diff --git a/source/this.txt b/source/this.scm similarity index 100% rename from source/this.txt rename to source/this.scm diff --git a/source/unsettled/1.txt b/source/unsettled/1.scm similarity index 100% rename from source/unsettled/1.txt rename to source/unsettled/1.scm diff --git a/source/unsettled/index.txt b/source/unsettled/index.scm similarity index 100% rename from source/unsettled/index.txt rename to source/unsettled/index.scm diff --git a/source/very-earnest-disclaimer.txt b/source/very-earnest-disclaimer.scm similarity index 100% rename from source/very-earnest-disclaimer.txt rename to source/very-earnest-disclaimer.scm