News for hackers. Stuff that matters.
Re:Building a Personal Internet from Markdown Files by JonChesterfield on Sunday January 07, 2024 @07:55PM (#38906933)
I seem to be in the middle of trying to build something similar to this. I want it to run on an android phone but otherwise the same sort of idea, offline-first information I want access to.

There's some weirdness around android browsers refusing to load html from the phone itself on security grounds. The OP uses a "progressive web app" which seems to be the proper way to do this at some point in the past, but firefox has killed that for some reason. Thus the most difficult part of the project seems to be persuading my phone to render html without copying the files to some server (or running a fileserver on the phone itself, to look at from the phone, which seems absurd).

What I can offer for people stumbling down the same path:

- Obsidian works fine as for ad hoc authoring of markdown while walking around

- It is known on stack overflow that markdown can't be sanely parsed into an AST

- That knowledge is kind of a branding misfire, the 'markdown' one is looking for is here https://github.com/commonmark/cmark

- That cmark binary + some foreach-file style script will turn markdown into html or xml. If you choose makefile and put spaces in the name of files you'll have a moderately bad few minutes cursing your tools

- Given that output xml/html, you can build whatever other html you see fit. I'm doing that with xslt but people are telling me not to

- That html can be written back to the obsidian vault and opened by a phone browser (at least if it's a single file)

- Obsidian doesn't really do headless, but leaving it running on one machine which repeatedly calls "make" to write the *.html files back into the vault works fine

- CSS thus far appears to be required, I was really hoping to annotate the html instead

First 90% done here, second 90% to go.

Re:Building a Personal Internet from Markdown Files by brokenmachine on Monday January 08, 2024 @12:36AM (#38908683)
I use Syncthing with Obsidian, works great.

You know Obsidian has an app on Android?

Re:Building a Personal Internet from Markdown Files by JonChesterfield on Monday January 08, 2024 @06:35AM (#38910626)
Yep. My idea is to edit things using the obsidian android app while away from desk, an x86 box somewhere notices the change and rebuilds the static website. I'm using obsidian's built in sync so writing the html back into the vault is an easy redistribution method. There's a flaw - when the network is down, I can edit things, but I won't see the update - but fixing that involves dealing with running code directly on my phone and thus far I don't have the patience.
Re:Building a Personal Internet from Markdown Files by rchaud on Monday January 08, 2024 @10:33AM (#38913378)
> There's some weirdness around android browsers refusing to load html from the phone itself on security grounds

OP here - I have been able to open single .html files on Android (browser uses 'content://' and not HTTP in the address bar; my initial attempt at a portable mobile knowledgebase was FeatherWiki, which is single-HTML. For HTML pages that referenced scripts or external images, it would only work on Android if I had an HTTP server app running. The SimpleHTTPServer app on Android is free and works for this.

Re:Building a Personal Internet from Markdown Files by JonChesterfield on Monday January 08, 2024 @10:53AM (#38913745)
Thanks, similar experience here. As long as I stash everything in a single file it opens adequately.
Re:Building a Personal Internet from Markdown Files by umtksa on Monday January 08, 2024 @10:55AM (#38913780)
https://phonk.app/ just added this to my bookmarks not affiliated