Hacker News new | ask | show | jobs
by JonChesterfield 722 days ago
This is an interesting direction.

One thought is that obsidian can execute web assembly and a parser / sema checker written in something that turns into wasm can therefore be run on the source files. Can probably tie that to a syntax highlighter style thing for in-ide feedback.

The other is that markdown is a tempting format for literate programming. I do have some notes in obsidian that are fed to cmark to product html. With some conventions, splitting a literate program into executable code embedded in a html document is probably doable as an XML pipeline.

In a much simpler vein, I'm experimenting with machine configuration from within obsidian. The local DNS server sets itself up using a markdown file so editing an IP or adding a new machine can be done by changing that markdown.

I hope the author continues down this path and writes more about the experience.

3 comments

> I hope the author continues down this path and writes more about the experience.

I appreciate it=) I definitely want to write some more stuff up, in particular how code organization changes when you can tag and add attributes to definitions.

> In a much simpler vein, I'm experimenting with machine configuration from within obsidian. The local DNS server sets itself up using a markdown file so editing an IP or adding a new machine can be done by changing that markdown.

This sounds really interesting, any code to look at anywhere or write up about it?

Simple enough to write inline.

There's a file called DNS.md which contains lines like `192.168.1.15 milan` in an obsidian vault. Obsidian sync copies it around. DNS is by pihole which uses a plain text file in that sort of format for the entries.

Then superuser's crontab -l

    0 * * * * cmp /home/jon/Documents/Obsidian/SystemControl/DNS.md  /etc/pihole/custom.list >/dev/null 2>&1 || cat /home/jon/Documents/Obsidian/SystemControl/DNS.md > /etc/pihole/custom.list && sudo -u jon pihole restartdns
Cron has rules about relative paths that I don't remember so it's literally written as above.

It seems likely that the idea generalises. I'm considering managing public keys for ssh / wireguard in similar fashion but haven't done so yet.

Yeah, I definitely see using this for literate programming. Not quite sure the best way to organize it. Maybe use a static site compiler to auto host documentation version.
I wish you could just use Obsidian Publish to host sites, but due to the indentation issue you have to control the rendering, which is a bummer.

Obsidian Digital Garden[1] is FOSS, so it might be modifiable parse and output the code pages correctly.

[1] https://github.com/oleeskild/obsidian-digital-garden

The typical Markdown answer to needing indentation preserved is the "code fence" (triple backquotes ```), though I imagine the problem with that is that Obsidian by default stops dealing with Wikilinks inside fenced code. I don't know Obsidian that well, but maybe there's a way to use a code fence and have it support Wikilinks inside?

A different direction to explore might be to explore proportional font coding techniques that rely less on whitespace. Lisp can be a good language to play with those ideas given whitespace isn't syntactic. Though idiomatic Lisp has certainly relied on semantic whitespace in coding styles for a very long time.

> I imagine the problem with that is that Obsidian by default stops dealing with Wikilinks inside fenced code

Exactly. Interestingly enough autocomplete is still triggered by [[ inside of a code block which is kind of funny. So writing code blocks works fine, it's just that they won't display with links.

> A different direction to explore might be to explore proportional font coding techniques that rely less on whitespace.

I'm definitely open to proportional font coding techniques being interesting, but in this case with all leading indentation unusable I doubt they'd be enough to get a normal experience. Unless you only write assembly so you can stick to the left margin <taps forehead>.

markdown -> xml -> hack around -> html is essentially a static site generator. https://github.com/commonmark/cmark works really well.