Having a template engine should be standard in all operating systems. It should be possible no matter where you are located or what you are doing to render out a template and get back the resulting string of text in a way that you can use it to accomplish the task you are doing. #
2023/08/21 #
-
-
cat << EOF > Text template rendering should be standard in all operating systems
It should be possible no matter where you are located or what you are doing to render out a template and get back the resulting string of text in a way that you can use it to accomplish the task you are doing.
Seems like an easy ask, but it's actually quite tricky because the UI is different depending on where you are and what you are doing. What that means is that it's not obvious how you get or provide the required inputs to the template rendering, but also how you use the resulting string.
Are you on the command line in a shell? Or on the Desktop? Or maybe you are in an app?
Where are the inputs you need to insert into the template? How are you going to get those? Manually type them? Auto generate them by running a script?
What are you going to do with the rendered string? Copy and paste it? Stick it in a file? Perhaps insert it into a form?
Once you stop to think about it for a few minutes, it's not at all obvious how to implement a system wide feature like template rendering.
The most obvious way might be to make it an enhancement to the standard copy / paste feature of the operating system. Have a way to run a script to fetch data, pass it into a template you select, and get back the rendered output on the clipboard ready to do with it as you please.
That would be really useful to me right now. I already have a title for this post. It's right there in the frontmatter. What I want to be able to do is select the title using the standard operating system copy feature, then run it through a template that would transform it as follows:
Text template rendering should be standard in all operating systems
would get transformed to:
text-template-rendering-should-be-standard-in-all-operating-systems
That would give me the text slug which I could use in the filename of this blog post's markdown file.
2023-08-21-081100-text-template-rendering-should-be-standard-in-all-operating-systems.md
You would probably need to have a library of utility functions you could use in your templates. In this case we would need some sort of slugify utility function as well as datetime manipulation functions.
I could continue using whatever editor I was using as normal, using it's 'Save As' feature, but no need to mess about getting the filename correct. In a couple of clicks it would be correct every time. It's small features like this that have the potential to remove huge bariers.
EOF
-
I think that maybe I've found the solution to the notes shouldn't have titles, but actually sometimes they need titles problem. Instead of a full on title, which looks weird next to a bullet point, just use bold text for the start of the sentence.
I noticed Politico does this in their newsletters and I think it looks quite nice. Sort of breaks up the wall of text, giving your eye something to focus on as you skim. I did it with the previous note. That one actually turned into a blog post. So that was quite nice. #
-
The thing that's very silly about all this overthinking of notes and titles and blog posts is that although it's definitely freeing to just start writting without worrying about a title, I do sort of end up creating a title anyway when I commit the file to the git repo.
For example the previous note item had commit message "Just use bold" and I'll probably call this one "Overthink silliness". So perhaps having to come up with a title isn't so difficult. Or maybe it's just that since the emphasis isn't on the title, it ceases to be a problem. If I really get stuck I could just not enter a commit message. No big deal. #
Today’s links:
-
🚀 New Post: Text template rendering should be standard in all operating systems - Thinking about how one would implement a system wide template rendering for text feature. markjgsmith.com #
-
Run a macOS VM on Apple silicon from a double-click with Vimy - Seems like quite a classic mac style app, minimal functionality but lots of deceloper usefulness. Also some interesting discussion about developer environment setup on this hacker news thread. There doesn't appear to be a standard way of doing things and with so many bits and pieces these says, it's getting ever more complicated to do safely. eclecticlight.co #
-
Nix - Reproducible builds and deployments - I've been noticing folks mention nix more and more. The example videos are pretty interesting. Seems like it could be a useful tool fir setting up dev environments, especially if you have to run many of these in parallel. nixos.org #
-
Don’t Build A General Purpose API To Power Your Own Front End - Quite opinionated piece that proposes a different way to build smaller scale website + API deployments. It's a way to side step a lot of complexity. As with most things, it's a trade off, but I think the author makes some good points which are at least worth considering. max.engineer #
-
We Need Deep News - Doc Searls known for his involvement in reporting on the early open source movement, has been covering the changing landscape of the news and radio sector. He's got a longer view perspective which is a good thing because we technologists have a tendency to build things that don't solve the fundamental problems. doc.searls.com #