Notes

Currently the code/config behind notes.rcrnstn.net is undocumented and mostly non-public. This is a result of it being the oldest of the “services” (in particular, older than git.rcrnstn.net) and not by design. This will change in the future. Here are some barebones notes in the meantime.

First thing to know: it’s very modular (read ad-hoc). The core is Apache with a bunch of AddType and ExtFilterDefine statements. This allows me to add support for different file types as and when I need them, with the details delegated to separate programs. Unix! The most prominent one is for .md (Markdown), which filters through Pandoc using pandoc-template-bootstrap-toc. There is also .dot which uses Graphviz (with a custom gvpr filter), code highlighting with highlight, and about a dozen less used ones.

Filtering through random commands is obviously not great for untrusted input. Keep that in mind if you want to copy this setup. Only I write to these files.

I do that with a script that mounts notes.rcrnstn.net:notes to ~/notes with sshfs and starts Vim in that directory. The goal is to be able to use Vim for most files, so I prefer plain text formats.

There is some behind the scenes HTML-to-HTML filters as well:

  • .ensure-viewport

    This makes the page more pleasant to view on small screens like phones, even if the author/converter/generator forgot to insert a <meta name="viewport"> tag.

  • .filter-tables{,.js}

    Injects Javascript that allows you to tag tables as filterable with a filter-table class. Inserts an <input type="text"> element before the table and only displays rows which match. I don’t think this is actually used anywhere at the moment, because assigning classes to Markdown tables is cumbersome.

Future improvements

  • Modernize the Pandoc template.
  • Use some fancy third party table filtering solution?
  • Use some header in the directory listing. Fuzzy searching? Graphviz sitemap?