I’ve wanted to make a blog on and off, to collect random notes on topics such as programming and math. It wasn’t so much that I wanted the world to hear what I had to say, as a place to put the random notes that I would otherwise have saved in various files scattered in my Documents folder. For my first post, I thought I’d put together some notes on how I wound up choosing the technology for this blog.
I’d always been interested in web development in a disconnected way. I knew how to make a web page in HTML. I learned a tiny bit of CSS. Some year ago, when Ajax was the big buzz-word, I even wrote a web page and Python back-end for our kids’ swim team that used JavaScript and jQuery to present meet in a nice table that could be sorted and filtered in the client.
Fast forward a few years, and I had run across node.js, and from there became aware of the more recent progress in web development. I installed node and npm on my MacBook, and based on some of the old tutorial projects in my source folder, I had even spent some time playing with the Ember application framework.
This all came to a head around Thanksgiving of this year. I noticed Amazon was selling an Amazon Dash button you could program yourself called the AWS IoT Button. I thought it would be fun to play around with, but then I thought, couldn’t I just make an iPhone app that had a few buttons that triggered AWS Lambda events just like the dash button did.
That led me to learn about web application frameworks, particularly Apache Cordova. (It appears I had forgotten all about my earlier flirtation with Ember.) I never did get my app working, mainly because I got lost in complications involving authentication and Amazon AWS. It didn’t help that I stubbornly refused to just hard code my keys, and tried very hard to do authentication the “right way” from the start.
But this abortive adventure did expose me to a lot of new technology. Eventually I signed up to audit a “full stack” web developer sequence at Coursera the first class of which which exposed me to Bootstrap. This was quite an eye-opener: you could make nicely styled, responsive web sites with way less effort than I had realized. I started noticing how many web sites seemed to be using Bootstrap, and acquired (or rather re-acquired) the habit of looking at the page source for every site I visited to see how they worked.
That was more or less how I spent my Thanksgiving. How I spent my Christmas included, at some point, a brief refresher of very basic probability. I wanted to write up a quick document of what I had learned. I normally use TeX and LyX for this sort of thing, but I found that the versions I had on my Mac were fairly out of date.
While updating my TeX installation, I ran across TeXmacs. This is a lovely program, better in some ways than LyX. Unfortunately, it seemed to crash often on my Mac. In the course of looking for something better, I found Markx. This is a simple web-based editor that runs pretty-much entirely on the client. It uses Markdown1 for text and MathJax for rendering math. It was pretty close to the most minimal editor I could possibly use for the notes I was taking.
At first I wanted to take Markx and turn it into a stand-alone single page app so I could use it instead of TeXmacs, which wasn’t working that great for me. It was nowhere near as nice to use as TeXmacs (or Lyx). In particular, the equations were edited in the linear TeX format, so you’d have to work with
\frac{(x+3)^2}{x^2-9} = \frac{x+3){x-3}
rather than working more directly with something that looks like the rendered equation:
\[\frac{(x+3)^2}{x^2-9} = \frac{x+3}{x-3}\]
but I still thought it was cool. I wanted something very simple that I could hack on.
While I explored the best way to convert that to a stand alone application, I ran across Randall Degges’ post “The Ultimate Guide to Deploying Static Web Sites on AWS”. If I could turn Markx into a completely static solution (not counting the JavaScript, of course), I could serve it via Amazon S3 as described in that article.
I decided to start simple. What was the best way to make a static web page? I found out about GitHub Pages but that wasn’t quite what I wanted. A bit more poking around turned up Hexos. I liked that it used npm and JavaScript. I’d never learned Ruby, which is what Jekyll is written in. And I found some pages that seemed to be using MathJax with it as well.
Soon, I was on my way. I found Christopher Martin’s Bootstrap Blog theme which tied in with what I already learned the previous month. Hexos had a working (though no longer maintained) plug-in that added MathJax rendering to the Markdown they were already using. Now I basically had Markx in my web page generator.
There were a few final wrinkles. I switched from Hexo’s built-in Markdown renderer to one based on Pandoc because I wanted to use a footnote in my Markdown, and Pandoc supported that. I found that the math plug-in I was using didn’t work with the new Pandoc renderer, but it turned out that Pandoc did most of the work for me anyway, and I just had to make a minor change to the Bootstrap Blog theme to include and configure the JavaScript.2
I’m fairly happy with the results. It took a couple of days to get everything more or less working, but tinkering with the software is half the fun for me.
Everywhere else, I’ve linked to the original web site for a technology, so why didn’t I link to John Gruber’s original post for Markdown here? Well, Markdown has evolved a lot, and the version I use is quite different from the original Perl implementation. But credit where credit is due. Markdown seems like a simple hack, but it is amazing how ubiquitous it has become. I’ve even found that
_italics_
works in Microsoft Outlook of all places!↩As I mentioned in my About page, the layout change I needed, came from this blog post. I love it when a plan comes together.↩