Croupier version v0.4.0 is out
What's Changed
- Support key/value in addition to files as input/output
- Implement a persistent k/v store
- Implement fast_mode
- auto mode with kv
Full Changelog: v0.3.4...v0.4.0
Full Changelog: v0.3.4...v0.4.0
One thing leads to another. I wanted to learn a new language and chose Crystal. To practice, I rewrote my standard practice project, Nicoletta, a static site generator.
That brought to mind doit a task/dataflow library, which made me want to implement something similar, so I wrote Croupier which went well, so I said "Why not write a more serious SSG, which is Nicolino which I think would not be complete without a feature from Nikola which I stole from Hugo, called shortcodes. So I had to write a shortcode parser.
What are shortcodes?
Sort of macros for markdown. You want to do a <figure>
but
markdown doesn't have it, so you do this:
{{% figure src="http://whatever" %}}
And you end up with a figure tag in your document.
That is done by passing data like that "src" argument and the context of the document you are writing into a template, which renders a piece of HTML, that's inserted where the shortcode was and bob's your uncle.
There are variants, and details, and subtleties, but that's the basic idea.
The bad news was that I was not the author of Nikola's current shortcode parser, that was someone else, and I really don't understant their code.
So I wanted to write it from scratch.
I have been wanting to learn ragel for a bit, let's say 10 years. It's a thing that takes a finite state machine description in a DSL and turns it into a parser in the language you want.
As long as you want one of the languages it likes, which is not Crystal, so I used it to generate it in C. And wrapped that in Crystal.
So, that's a very long way to say that I wrote a Shortcode parser library that can be used from Crystal and from C, and since it can be used from C, it can be used from pretty much any language.
It doesn't implement the whole shortcode "specification" (which is not a real thing that exists) but it implements the basics.
Now, I just need to use it in Nicolino, and eventually make it better as needed.
BTW: Ragel rocks.
I have all my computers in a Tailscale VPN which means I can see them all as if I were directly connected to them.
Recently I got a new desktop computer which is, for my standards, ridiculously fast. So, it makes sense to develop things in it even when I am not in front of it.
Since VS Code is basically a web app, the idea is to use code server running in it and access it via VPN.
Did it work? OH YES.
Performance is practically the same as running VS code locally, similar to using GitHub codespaces.
Did it need any special config?
Just one. To make Chrome stop complaining about "insecure context", it needs to be accessed via HTTPS, even when it's done over a completely encrypted tunnel.
Luckily, it's very, very easy.
So, just get caddy, and use this Caddyfile
:
mindy.tailABCDEF.ts.net
reverse_proxy :8088
Yes. Two lines. The ABCDEF part will be different for each tailscale network.
And that's it. Access it using https://mindy.tailABCDEF.ts.net and ... that's all. I am shocked at how well it worked, and how easy it was.
Make tasks not be default
by default. This means that if you
don't specify a task when invoking hace
, nothing will happen.
This is a breaking change.
Added self
to exposed variables in tasks. This can be used
to achieve what you would use $@ or other automatic variables
in Makefiles.
Added -f
option to specify a Hacefile to use.
Added -n
option to do a dry run.
Added always_run
flag for tasks which causes them to always
run even if their dependencies are unchanged.
Implemented --question
flag to ask if a task should be run.
Implemented auto
command, which continuously rebuilds as needed
reacting to filesystem changes.
What's new?
TaskManager.save_run