Journaling on iOS With Shortcuts

4 minutes read

I want to keep a journal, I have three requirements:

  1. The data must be stored as plain text and plain images on disk, that I own.
  2. The entries must be labelled with their creation timestamp, location, and ideally weather information.
  3. I want to be able to create a journal entry from an image. The above metadata should be loaded from the image.

I started journaling with Day One1. After it got sold I have lost faith in its future. They also use a proprietary database with limited export options which fails my condition 1.

Apple’s Journal looked interesting, but it does not satisfy my conditions 1 and 3.

I looked into self-hosted options:

Diar - iOS shortcuts for authoring journal entries

When I squinted at my requirements I realized that what I need is a Hugo3 blog with a login and different syntax + some goodies, and a couple of iOS shortcuts.

I always start programming by defining my data structures. First, I’ve decided on the syntax of my entries:

Since the only mandatory metadata is the timestamp, the obvious format is a markdown file with the timestamp as filename and the entry in the text.

For the other metadata I wanted something human readable and editable. I didn’t want to use a preamble like Hugo does.

My solution is to add a footer using the --- markdown syntax for a horizontal rule. Then use hashtags for tags, lines starting with /images/ for images, location prefixed by @ and a simply parsed weather. If there is a line that matches neither, it is interpreted as plain text location.

E.g.: in a file named 2006-01-02T150405.md:

This is an entry inside my journal, as you can observe it just starts as a plain text.

You can use markdown. I only really use emphasis and blockquotes.

---
/images/a-nice-illustration.jpg
#rhea #journaling
Home, France
@48.8687162,2.2219584
17°C, Cloudy

All of the footer entries are optional.

It was easy to create two shortcuts in iOS to:

  1. Grab the current location, weather and address and write a new note with current timestamp as filename with this information. Then open the file immediately with iA Writer.
  2. Receive an image, use it’s exif to get the time and location. If the date is today, grab the weather. Copy the image into the desired location, create the note and open it in iA Writer.

The advantage of handling images this way is that iA Writer supports displaying them in preview mode.

For the first use case the shortcut looks like this:

Create a text entry using Diar

Rhea - Go server to render the journal in a nice way

Since I knew Hugo was almost what I wanted, I decided to learn Go and write my server.

My design goes roughly this way:

  1. Fully server-rendered html page.
  2. No static rendering, live-running server only.
  3. Single user, the login credentials are passed through environment.

The program should do the following.

  1. On startup look into the directory that contains the entries.
  2. Iterate over the entries.
    1. If the entry contains an image, generate a thumbnail for it if it hasn’t been done and store it in a cache directory.
    2. If the entry contains a location, use MapBox to fetch the map, and store it.
  3. Start watching the entries directory and update the in-memory representation if anything is added or changed.
  4. Start a web server that serves:
    1. / - At root show list of the first page of entries, show the location map if the location changed from previous entry by more than 50km. Show images as thumbnails.
    2. /after/TIMESTAMP and /before/TIMESTAMP to serve a next/previous page.
    3. /memories/TIMESTAMP - Show a detailed entry with full size images and a more detailed location map.
    4. /images, /thumbails, /tiles-ZOOM, static - Just serve the files.
    5. /login - Render this page if there is no valid session cookie set.

And that’s about it. Cook this with some nice templates and a bit of CSS and we have a journaling app.

Rhea Screenshot

If you would like the source code feel free to ask, I am no longer publishing my repositories publicly.


  1. https://dayoneapp.com/ ↩︎

  2. https://www.journiv.com/ - looked promising but the setup is too cumbersome. ↩︎

  3. https://gohugo.io ↩︎

"Bespoke" Might Be the Future

Draft One minute read

The other day I have shared the workout tracker I have written for mysef with a friend. Soon enough I have started getting feature requests and suggestions for improvement. I disagree with almost all of them.

The problem is that I use every feature of the tracker, I remove any feature I might not be using anymore, and I implement any feature I want to have.

I have written most of the application by hand, maybe the initial 90%. However, at the end of the line, I have used agents quite heavily and it pushed me trhough the last 90%.

Gatekeeping your hobbies

Draft One minute read

It is okay for something to die.

Know Your Fitness Influencer

Draft One minute read

Here is a little overview of the current most popular fitness influencers, and what you should know about them before listening to anything they say.

The Team

Alexander Bromley

Bro Strongman

My favourite at the moment. Unfortunately the last video contains AI generated animations which I’m not fond of.

Mike Israetel

Science Based Mentally Challenged

Milo Wolf

Science Based Bootlicker

Greg Doucette

Bro Supplement Peddler

Drug dealer with a loud mouth. Has an absolutely insane video editor.

His videos are 90% drama with some workout advice sprinkled on top. His workout advice is extrememly basic and generally good.

Do not listen to him concerning supplements, even if everything he sold worked, he is still very much in the game of peddling turk (which has never shown any efficacy).

Jeff Nippard

Science Based

Lylo

Science Based

Jeff Cavalier

Science Based

Used to be good, but fell down the trap of chasing relevancy. Probably natural at some point, but hard to believe that one can retain 6% body fat year long at 50.

The Conclusion

Why is modern writing terrible

Draft One minute read

… because most writing during most ages was terrible, but the only surviving and known pieces from the past are those which stood the test of time.

This was the conclusion I got to. This article is about the journey how I got there.

These are my notes on two videos by the writer Hilary Layne: Modern Heroes are Weak and Boring and Modern Villains are Pitiful and Impotent.

Both issues stem from the lack of objective morality in the worlds created by modern writers.

The concepts of Good and Evil in modern literature are based on how it makes the reader/writer feel. This makes them extremely malleable and ultimately meaningles.

Readers prefer anti-heroes because they are closer to the classical definition of a hero: “The main male protagonist of the piece”. Anti-heroes are closer to objective morality as they can act, whereas modern heroes can’t.