I like to write content in markdown because it's simple and you can use just about any text editor to do it. There are nicer markdown editors, of course, such as Ulysses and Obsidian, but when it comes to publishing the content (HTML, PDF, EPUB, etc) they ... aren't so good.
And then there are other publishing targets to consider. What if you wanted to pop those markdown documents into a database, for instance? Or maybe transform them so they can be used with a template like Compass or Syntax for documentation?
This is usually a manual affair with the use of shell scripts here and there. That means it's the perfect thing for Claude Sonnet.
Using Claude to Create a Compiler
Many people are hesitant to use AI tools for fear of "crap code" or creating an unmaintainable mess. But what if the code is something you really don't care all that much about in the first place? Like a shell script?
For some of you, shell scripts are straightforward and simple. You crack out some bash and boom! You just resized your blog images. I, on the other hand, can't seem to remember bash syntax for my life. Which is why I ask Claude to do it for me.
That's what this week's video is all about. Instead of bash, however, we'll be creating a compiler in JavaScript. This is stuff I could have figured out on my own, sure, but as you're about to see, it took me all of 45 minutes or so to have Copilot/Claude:
- Assemble the markdown files into template-ready files.
- Create a JS manifest that the template needed.
- Copy over all of the files to the target directory.
- Create a Makefile to automate the process.
This is where AI becomes fun! Hope you enjoy.