I just implemented a small shell in 29 lines of Python that has support for redirects:

$ ./minishell.py 
~~?~~> echo hello
hello
~~0~~> wc -l minishell.py
29 minishell.py
~~0~~> wc -l <minishell.py >report.txt
~~0~~> cat report.txt
29

Linking (and how it has evolved) in Smart Notes

I created Smart Notes to be a digital note taking application that follows principles from the Zettelkasten method, as explained in Sönke Ahren’s book How to Take Smart Notes.

Two fundamental aspects of the Zettelkasten method are notes and links between them.

In a physical Zettelkasten, notes are written on index cards (or some similar format), given unique, hierarchical ids, and stored sequentially in a slip-box:

Illustration of physical Zettelkasten.

Sönke writes that you should add a new note to the slip-box directly behind the note you are referring to. That creates one kind of link. He also writes that you can add it behind multiple notes by by referring to its unique in other notes.

Here is how I realized this aspect of the Zettelkasten method in Smart Notes:

Screenshot of Smart Notes showing how notes and
links are represented.

Some design decisions and my reasoning about them:

  • Notes are visualized as a physical index cards. That restricts the amount of text that you can write on them. I felt like a problem with a digital approach might be that you write too much on your notes because there is unlimited space. I was also interested in mimicking the feeling of working with physical index cards on a table.

  • Links are visualized as strings between notes. You can link however you want. In the above example, the note related to both notes are added behind both the first note and the note that is related to the first note. (The note is shown twice, but it is the same note.)

  • Note ids are not shown in the UI. In a physical Zettelkasten, note ids are important to be able to find a note when following a link. (If a note says “see note X” you need to be able to locate X in the slip-box.) But in Smart Notes the link is right there and shows the note that it links to.

Trains of thought and branches

Another aspect of the Zettelkasten method is trains of though. Notes related to each other can form a train of thought, and reviewing that train of though is useful. In a physical Zettelkasten related notes are stored close to each other, and following a train of though can be done by flipping through the cards in an area.

I was thinking about how this aspect of Zettelkasten could be realized in Smart Notes.

I read more about how notes are stored and numbered in a physical Zettelkasten. There seems to be two cases. Either the note is related to an existing note, in which case it is put right behind it, or the note is not related to any existing notes, in which case it is put at the end.

Furthermore, if a note is related to an existing note, a distinction seems to be made if the new note continues the train of though of the previous note or if it branches off. With the Zettelkasten numbering system, it might be possible to distinguish these different cases. In Introduction to the Zettelkasten Method, Sascha writes:

The very first note is assigned the number 1. If you add a second note that is not related to the first note, it is assigned the number 2. But if you want to continue the first note, or inject something into its content, comment on it, or something along those lines, you branch off. That new note would get assigned the number 1a. If you continue with this new note, you would go on with 1b. If you then want to comment on the note 1a, you would create a note with the address 1a1. So, in short, whenever you continue a train of thought, you increment the last position in the address, be it number or a character from the alphabet. And when you want to expand, intersperse, or comment on a note, you take its address and append a new character.

Smart Note lacks any visible note ids. So I was thinking that I might be missing out on something. What types of hierarchies are created with the numbering scheme in Zettelkasten? Can I already replicate those hierarchies in Smart Notes?

Folgezettel

There seems to be a debate going on whether the numbering scheme in Zettelkasten, sometimes called “folgezettel” is useful or not.

In No, Luhmann was not about Folgezettel, Sascha argues that the kind of links created with folgezettel are weak. We know that there is a relationship between two notes, but we don’t know what that relationship is. Sascha further acknowledges that the folgezettel technique is probably more practically useful in a physical Zettelkasten, but in a digital world, creating annotated links is a better solution. (Creating annotated links is certainly possible in a physical Zettelkasten, but browsing those links would be tedious because the note in the link might be in a totally different place in the slip-box.)

In Folgezettel is More than Mechanism, Bob argues that the folgezettel technique is useful even in a digital world. One point is that it allows you to get a bird’s eye view of the topics and threads that are developing in your Zettelkasten. Another point is that it forces you to think about note relationships when you add notes to the slip-box.

I’m starting to think that the mechanism of folgezettel is just about creating hierarchies of notes. That’s certainly possible already in Smart Notes. Perhaps the numbering scheme is not essential to the Zettelkasten method? Perhaps I should explore annotated links more instead?

Sascha’s point about annotated links and their importance got me thinking how to apply it to Smart Notes. (In Backlinking Is Not Very Useful – Often Even Harmful, Sascha talks more about the importance of adding context to links.)

Here is one thought I had about it early on:

An unclear link between two notes can be clarified by inserting a note in between that explains the reason for the link. A -> B can become A -> explanation -> B.

Many years later, I tried this out. It looked like this:

Screenshot of Smart Notes showing the use of a
link note.

I found that the “explanation note” took up much space and made it more difficult to navigate the note network. That’s when I decided that Smart Notes needed the ability to annotate links instead. Here is how it turned out:

Screenshot of Smart Notes showing link
annotations.

I’ve only experimented with this a little, but I find that navigation is easier. My hope is that short “linking phrases” (inspired by concept mapping) will be enough to annotate links.

Closing thoughts

With annotated links added, I think Smart Notes is pretty flexible. First of all you can create arbitrary tree-like structures that can mimic the structure you get from folgezettel without having to deal with a complicated numbering scheme. That structure can give you a bird’s eye view that Bob talks about. If you don’t want to emphasize a tree structure, you can use annotated links to link arbitrarily and make the context of the connections clear.

I try to make Smart Notes a digital note taking application that follows principles from the Zettelkasten method. Sometimes it is easy to focus on the specifics of the method and try to replicate it as closely as possible. But I think it is more important to experiment and see what works. Smart Notes has been my way of exploring Zettelkasten, and I will continue to tweak it as I learn, both from reading and researching, and from practicing. Most importantly, I will try to use my notes for creative output and learning and try to notice what features in Smart Notes maximize that.

Did another bike workout at the gym. Similar heart rate and duration as my regular runs, but felt like more effort because I’m not used to cycling. I’d rather be running, but this is a good alternative. Listened to Hej (resten av) internet! Avsnitt 2: Nyhetsbrev (eller brev kort och gott).

Today I bought a gym membership. I spent another 40 minutes on the bike. I felt good after the workout, but I didn’t get any ideas or inspiration like I usually do when I’m running. Hopefully I can incorporate some runs soon, but I will for sure continue biking to help build an aerobic base.

Yes! The draft makes sense now. I think. I had a rough idea of what I wanted to write about. I had lots of notes that I struggled to fit into a coherent narrative. But finally, it all fell into place. I clarified my thinking by writing.

Today I spent 40 minutes on a bike in the gym. I’d rather be running, but I’ve got some pain in my achilles tendon, so I explore alternative training at the moment. For this workout, I happened to discover the (Swedish) podcast Hej (resten av) internet! It feels like an entry into an alternative, beautiful web-universe. I look forward to more workouts with them in my ears.

It’s time for a new avatar. I’m thinking I should update them more frequently. Maybe yearly? Anyway, here is the new one.

A picture of me.

It’s like it’s all out there. Energy, motivation, well being, creativity… You just have to put on a pair of shoes and go out and get it. That’s why I run.

Me running.

How I found out about Micro.blog

When I was researching the Zettelkasten method (a specific way to take notes), I ended up on Writing Slowly. It looked like this:

Screenshot of Writing Slowly website.

Besides the content, that I was also interested in, I thought that this was a nice looking blog. It had a clutter free UI, nice formatting, and support for pages and categories. I thought that I would like to have this as well. (My current blog that is hosted as a static site on GitHub Pages is in need for an update.)

Then I noticed this at the bottom of Writing Slowly:

Screenshot of Writing Slowly Micro.blog link.

It looks like Micro.blog hosts the blog. And that posts can be commented on via the Fediverse as well. This looks cool.

I started reading about it. Both in the book Indie Microblogging by Manton Reece and on their about and help page. I got more and more intrigued. I decided to try it out, and about a week after accidentally stumbling across Micro.blog, I had moved my blog there.

I’m looking forward to exploring this new universe at Micro.blog.

I just implemented support in Smart Notes for giving links a text description.

This was inspired by recent readings about concept mapping and Zettelkasten resources talking about the importance of giving context when linking two ideas.

I’m looking forward to using this to see if I find it helpful.

Screenshot of Smart Notes highlighting link texts.

My website as a home (found via End of Year Hyperlink Dump) talks about a metaphor for websites:

I feel as if someone is giving me a tour of their apartment: I’m looking at the papers on his desk, the notes stuck to his fridge, an album of butterfly photos taken by his brother, and so on.

I like this metaphor, and I would like my website to feel like a home. Micro.blog makes this very easy. I can share and develop my interests. I can structure content with categories and pages. Others can come have a look. Comment if they wish. And you can see conversations that I’ve had with visitors.

I first learned programming by hitting “View Page Source” on a web page to learn how something was implemented. Today, 20+ years later, I did the same. I wish more environments had “View Page Source” function.

rickardlindberg.me/2024/08/0…

Poor man's redirect in a static site

I just moved my blog to Micro.blog. My domain name, rickardlindberg.me, now points to the new blog. I have not yet migrated all pages from my old blog. But it is still available at http://archive.rickardlindberg.me/.

But what about existing links to my blog? They won’t work. I could configure the web server to redirect requests to the archived site for pages that I have not yet migrated or that have migrated to a new URL. However, as far as I can tell, there is no way on Micro.blog to easily configure many redirects. (You have to to it manually one by one, which is tedious for hundreds of URLs.)

Then I came across Sven Dahlstrand’s blog, which is also hosted on Micro.blog. When I tried visiting a page that did not exist, I saw this:

That got me thinking that I could provide a textual explanation that the page has not yet been migrated on my 404 error page. (You can customize the 404 error page on Micro.blog.)

But, how is this possible? Micro.blog hosts static sites, and there is no way for a static site to render dynamic HTML depending on the URL.

Then I did what I first did when I learned to program 20+ years ago: I hit “View Page Source”.

I realized that the dynamic part was rendered with Javascript:

<p>Sorry, <span id="this-page-text">this page</span> could not be found. Don&rsquo;t worry, you didn&rsquo;t break the internet. It&rsquo;s probably my fault. 😅</p>
...
<script module>
const thisPageText = document.querySelector('#this-page-text');
thisPageText.innerText = `${thisPageText.innerText} (${window.location.pathname})`;
</script>

I was confused by <script module> and the backtick syntax. Most likely Javascript has changed a bit since I last worked with it.

I put together something similar, with more familiar Javascript, for my 404 error page:

This page has probably not been imported to my new blog yet.

<p>In the meantime, you can find it here: <a id="here-link"
href="http://archive.rickardlindberg.me">http://archive.rickardlindberg.me</a>.</p>

<script type="text/javascript">
var hereLink = document.getElementById("here-link");
var path = window.location.pathname;
var archiveUrl = "http://archive.rickardlindberg.me" + path;
hereLink.href = archiveUrl;
hereLink.innerHTML = archiveUrl;
</script>

(The <p> tag in the second paragraph seems to be needed. Otherwise the Micro.blog Markdown processing will turn the link in the “a-body” into another link tag so we end up with nested links which makes the Javascript not work.)

Thank you @sod for showing me that this was possible, and for making me re-live the experience of first learning to program. I wish more environments had a “View Page Source” function.

I was tired and low on energy. I knew I needed to run. I know that the longer I run, the more energy I get back. I also clarified my thinking on an upcoming blog post. Yey running!

Today I did a lot of focused work. My brain was tired. Solution? Running. It worked. It always works. That’s why I run.

Output Tracking vs Mocks

This post has not yet been imported to my new blog.

In the meantime, you can read it here: http://archive.rickardlindberg.me/writing/output-tracking-vs-mocks/.