News for hackers. Stuff that matters.

not_skynet

It does allow dumping to/recovering from json, apologies if that isn't well documented.

Calling `x: str = json.dumps(MyClass(...).serialize())` will get you json you can recover to the original object, nested classes and custom types and all, with `MyClass.load(json.loads(x))`

going to shamelessly plug my own library here: https://github.com/mivanit/ZANJ

You can have nested dataclasses, as well as specify custom serializers/loaders for things which aren't natively supported by json.

going to shamelessly plug my library for python architecture visualization here: https://github.com/mivanit/dep-graph-viz
Re:Evolving my note-taking processes on Friday September 09, 2022 @07:29PM (#32786111)
I use [Dendron](https://www.dendron.so) for this. You can add tags or links to any entry, and the targets of those links will have backlinks. There's a nice "daily note" mechanism as well.

[Foam](https://github.com/foambubble/foam) seems very similar but I haven't personally tried it.

Show HN: Minimal Static Site Generator

https://github.com/mivanit/pandoc-sitegen

`pandoc-sitegen` uses pandoc and mustache templating to turn a bunch of markdown files into a minimalist site, while still allowing for things like an automatic list of blog posts.I was really frustrated with the complexity of most existing static site generators like Jekyll and Hugo -- it seemed like even a basic blog required an immense amount of configuration and provided tons of features I...

( Read More... | no comments | 5 points | on HN )
Re:The appeal of using plain HTML pages (2019) on Tuesday May 03, 2022 @01:30AM (#31244987)
this is probably the best chance I'll get to plug this on HN: https://github.com/mivanit/pandoc-sitegen

It's a truly dead simple static site generator that uses pandoc to turn the markdown into HTML, and mustache as the templating language. It's about 400 lines of actual code total. It doesn't include an actual server, it just converts your markdown files into HTML. It's by no means finished but I use it for my personal website.

Re:How the Python import system works on Saturday July 24, 2021 @10:21PM (#27946133)
I actually spent time wrestling with exactly this earlier today, and I think I finally have a 2 line solution for it:

https://pastebin.com/5WCXb2Gg

Assuming `foo.bar` is a script inside the package `foo` that you want to both import and run directly (without `python -m ...`), this lets you do so without too much hassle.