Making a Racket
Jan XXrd, 2025 - Initial release
Blogs are a very interesting thing...
Having a blog implies that you believe your thoughts should be seen by others which can often be problematic. I mean that is a whole plot point in "The Social Network"! For those unaware while making the original facebook, a classmate rating website (disgusting), blogs about his breakout and says many terrible things about his ex. At my university there is a professor redactedHe still works here... :), who has a blog and he has a number of questionable "thoughts" on that blog. That is something that I hope to avoid with this, in fact I plan on divulging no thoughts what so ever.
...
...
...
ok no I do need this though...
"Wait... but if you don’t want to share your questionable world views with a wider audience then whats the point of a blog??" You might be asking.
Well, hopefully me it can act as a project journal so that someday I can get a job!
Hello World!
The first decision that I had to make when creating this was the how. As in what framework, or static site generator, would I use to make my life easier.
I could have gone with the most simple HTML but ngl that sounds like a bit too much work! Another option would be to use something like one of the hundreds of markdown based static site generators, and any of those would have probably been good options but I like to suffer. The choice was clear and had been calling out to me since the end of Fundies 1 last year.
Racket
For those of you who don’t know what Racket islucky you... jk we’ll get to that, it’s a programming language that is used by a few select universities and thats about it. This post isn’t about the specifics of Racket so feel free to look into it yourself, all you need to know is that its not commonly used and uses a lot of parentheses (based on scheme).
Here is a fun fact fact about racket, it has essentially everything! A result of primarily being a teaching language used at universities is that racket has a very large repository of packages. One of those packages being scribble!
Scribble seems like a perfect balance between ease of use and being just complicated enough to not make me dreadfully bored! Plus it has the advantage of getting me to keep using racket, at least somewhat.
Beginning to scribble some words
The first thing I had to do was actually learn how to use scribble. I hadn’t used racket in roughly a year so I also needed some brushing up on the way that it works. Old assignments and ChatGPT to the rescue!!
After looking through some old assignments and trying to re-understand the code I had written I figured it was time to give scribble a shot. Luckily for me the scribble documentation begins with lots of examples so working through the first few chapters of the documentation gave me a good foundation to begin this not a blog.
I made some files for this and a few other projects that I planned on writing about. I created a template which contained title, author, etc so that I could quickly start up a new post. Then finally I was able to begin writing!
After a while I had some posts that were somewhat ready to be published so now came the task of creating the index page and figuring out the best way to make sure posts got added to the index automatically.
Automating life
I might eventually talk more on my feelings on ChatGPT and other LLMs, generally im not a huge fanthey have their place but 90% of what they are used for is not that!, but for now lets just say it took me probably close to two hours to get ChatGPT to write the following code
#lang scribble/base (define (generate-scribble path input-file output-file) (copy-file input-file output-file #:exists-ok? #t) (with-output-to-file output-file #:exists 'append (lambda () (for ([file (in-directory path)] #:when (regexp-match? #rx"\\.scrbl$" file)) (let* ([relative-path (path->string file)] [trimmed-path (substring relative-path (string-length path))]) (printf "@(include-section \"posts/~a\")\n" trimmed-path)))))) (generate-scribble "scribbles/posts/" "scribbles/not_a_blog_og.scrbl" "scribbles/not_a_blog.scrbl")
all this code does is dynamically include the posts in the top-level .scrbl file so that all the posts appear on the side bar.
This is also 1000% not the final version of this code, I want to have it add the files in chronological order however that will require a fair bit more complex code that I will need a bit more racket practice to accomplish. My current thought is that the files can be named with a date before the title - currently the file names are title_of_post.scrbl - and then the program can sort the list by title before appending to the end of the duplicate file but nothing is decided yet.
I used to use a piece of software called Obsidian which used markdown and one of the most popular plugins added a metadata support feature so in an ideal world I would probably functionality similar to that to scribble but that sounds like quiet an undertaking.
What’s next???
A good goal would be to create a script that automagically creates and updates the title/tags so that if I decided to change something, such as an email..., I don’t have to manually go through and edit each file manually.
—
extras —
🌲 Why people hate racket
Evergreen Section - Last edited Jan 23rd 2025
writing is hard... more words coming eventually.
For now go check out this.