💾 Archived View for gemini.hitchhiker-linux.org › gemlog › capsule_migration.gmi captured on 2024-03-21 at 15:33:57. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-06-14)
-=-=-=-=-=-=-
I spent my little bit of free time the last two days doing some code cleanup and documentation passes on Vostok. I'm sure that it's not "fully baked" yet, but it was close enough to migrate the capsule over this morning. Overall, I'm pretty well pleased with the result. The actual migration probably only took about 20 minutes, involving initializing the capsule, and then adding the relevant metadata to each post in order to recreate things as close as possible after running vostok build.
There is still a lot to document before I would want anyone else to use it. I've pretty much finished with the rustdoc comments, but I want to write a bit of a guid to it's usage. The cli is actually pretty nicely self documenting, but some things won't be obvious if you didn't write the code. Example, on the main index page, the string {% posts %} will get replaced with a section of links to the most recent gemlog posts. I've tried to keep things like this to a minimum and didn't want anything like an html template engine, but for some things that sort of simple string replacement just makes things nice and flexible.
There's also a couple of papercuts to clean up. The main site index and gemlog index must be created manually, and have to exist or the capsule will fail to build. I'm going to change this behavior so that the main index gets created when the capsule is initialized, and so that the gemlog itself is entirely optional. Basically when this part is complete running vostok build will render the gemlog if the "gemlog" subdirectory exists and has at least one post, and create a generic index if no index page exists.
I was giving some thought to parallelizing the application, but considering how quickly the build completes I think it would essentially be a waste of effort. On a Raspberry Pi 4 it completed basically instantaneously, and I had to check to be sure it did in fact generate anything (it did). That's a nice testament to how easy it is to write nice, efficient Rust, because I'm not particularly great at it..
Another nicety was my recent discovery of the clap-complete crate. Adding this along with clap as a build dependency allowed me to have cargo generate shell completions as part of the build during compilation. The generated completions are also quite good. The only thing I feel they are currently missing, is that I would love to be able to tab complete when I'm typing in a path. But that's a minor issue. Currently it's making completions for Bash, Zsh, Fish and PowerShell. This has worked out well enough that I went in and added the same feature to gfret.
I have a small list of features that I want to work on in the future. This is the running list, kind of for my own future reference.
And for my own personal use of Vostok
All content for this site is licensed as CC BY-SA.
© 2022 by JeanG3nie