Notes will be markdown, I'll probably use Marked (EDIT: I went with react-markdown)
Looking around for info on [[]]
, it looks like this is commonly referred to as "Wiki links" and there are some nice tools for using them in VSCode.
Don't know how long I'll be writing notes in VSCode though, so I'll sort of ignore for now. I just wanna see how easily I can parse them.
Some collected notes on progess:
Huh, neat. https://nodejs.org/dist/latest-v10.x/docs/api/fs.html##fs_fs_promises_api
44 minutes in I'm now able to read in my posts and parse Backlinks. I had to learn negative lookbehinds to do this since I wanted to allow code samples such as [[foo]]
untouched. Works similarly to lookahead which I'm familiar with.
I'd like to write this out to HTML somehow to prototype an interface, then I'll build forward links. Committing and taking a break for now.
Andy Matuschak's notes will serve as a pretty big inspiration for these. One key difference is brevity.
I'd like to display my notes in more of a "card" format than something that better serves long-form writing. I'm just not good at long-form writing.
I'll probably use Next.js because, as much as I'd like to build my own slim thing - Next is really, really good.
Yeah Next.js served me well (thanks, team!). Make a pages/
directory, [id].js
with getStaticPaths
and getStaticProps
and done.
I also swapped out the markdown. Marked is good but I wanted to leverage next/link and the following GitHub discussion (I didn't even know GitHub had discussions?) gave some working code with react-markdown: https://github.com/vercel/next.js/discussions/17088
Linking out and in was trivial :) For now I'll display em after the post contents. When I get serious about Displaying the notes I'll figure out how to make cards pretty.
next/link is really easy to use. Just <Link href="...">...</Link>
and you've got client-side routing for free. Continually impressed with Next.
I'd like to deploy to see if it's really that fast. Each time a post is rendered I might be regenerating the database (reading from the filesystem...). Anyway let's see how it holds up.