About this Website

I'm trying to learn about web technologies at the same time as making some posts. As such I'm following my usual practice of getting comfortable with the most basic abstraction before using the more complicated ones.

For web I have the following plan:

  1. Use HTML and CSS only.
  2. Allow a basic compilation step.
  3. Allow more complicated compilation step.
  4. Include Javascript (minimal use of libraries).
These steps can also be written as below
  1. No compilation, no scripting.
  2. Basic compilation (e.g. C pre-processor), no scripting.
  3. Programmatic compilation, no scripting.
  4. Programmatic compilation and browser scripting.

I'm noting those things I want on the webpage, but as yet don't have. At each step I'll try to introduce these features, and/or go back to see if features already implemented could be implemented better using the new technology.

Missing Features

Deduplicating HTML

HTML & CSS

As far as I can tell, there is no way to include snippets of HTML instead of manually adding the same <head> in each HTML file of the page.

With Compilation

This would be trivial with the C Pre-Processor, and I assume with any static website generator too.

Categorising Posts

HTML & CSS

With such a small number of posts, categorisation by hierarchical file system is more than sufficient. This may change when I write more posts.

Automatic Indexing

I currently have to manually index my posts on the main page, this is error-prone and tedious (or at least would be if I had a lot of posts). I would like a way to automatically index them, either by pointing to an index node from the main page or by automatically including an index in the main page.

HTML & CSS

While this is possible by specifying directory indexing in the HTTP server settings, github.io doesn't allow configuration of the server (which is fair enough).

With Compilation

This is the obvious way to combine all posts in some category into a HTML list.

Insertion of Code Snippets

HTML & CSS

While I'm sacrificing the ability to view a file in the browser so I only have my program code defined in one place (see here), including code snippets in the web page is important enough to make the opposite tradeoff.

I do need a per-snippet compilation step where I HTML escape the code from one file before inserting it into the HTML file.

With Compilation

In a perfect world I would be able to label positions in my source file, and have that automatically inserted into my page. This would combine the manual per-snippet compilation step into the already present compilation step for generating the site.

Syntax Highlighting of Code Snippets

I have a reasonable amount of code in my posts, it's nice to highlight them according to syntax.

HTML & CSS

As there is already a per-snippet compilation step, it takes little effort to make it include syntax highlighting. This can be done with a few programs online, or with the :TOhtml vim command. As I'm already copying the text from a vim buffer, the :TOhtml command is the obvious way to work.

With Compilation

With a compilation step, the syntax highlighting could be applied in the same manner, but rather than applying the vim specific syntax items it would make more sense to use some plugin.

With Javascript

I have seen quite a few javascript libraries to syntax highlight code, but I'm not sure what their benefits are over using the compilation step to mark the syntax items with a <span> tag.

View Code in Browser

HTML & CSS

This is perfectly viable by customising the server to specify the mime-type of my source code files as text/plain, but again I don't have control over the server configuration.

Even with customisation of the server, there would be no syntax highlighting, so this wouldn't be perfect.

I could manually convert the source files to HTML files, or plain text, but I then have to make sure to update the derived file every time the canonical file changes.

With Compilation

If there is already a compilation step, then I can put the work of converting the canonical file to a derived file in there, and everything will be fine.