Markdown Magic

Markdown Magic

When coming back to web development after years of absence one of the first concepts that I had not previously heard of was “Markdown” files.

Fortunately this one is quite simple, very useful and small enough to quickly get your arms around. After a little bit of research I found that:

In 2004, John Gruber introduced a software project to aid in the conversion of text based content to formatted HTML that gained traction and is now used throughout the web. A great idea, simply executed, that caught on and changed the way that things are done.

The gist of this capability is that using simple codes such as “**” for Bold and “#H1,#H2,#H3, etc.” for Heading Levels, one could generate text that could be transformed into HTML code for use on formatted web pages. Reminds one of the Lightsaber,

An elegant weapon of a more civilized age.

A tool called Dingus can be found on John Gruber’s site that provides a live sandbox to explore various markdown codes.

Not much more to say about this except that in Hugo Themes it is common that a Table of Contents capability is typically provided that can cause a Table of Contents to appear on pages that contain Markdown heading tags “#H1,#H3,#H3, etc”. This is enabled in the Params section of the configuration file.

[Params]
toc=true

This can likely also be specified as a local matter using “Front Matter” in a content file, but in my case I have made an engineering decisions to only use heading codes when I want a Table of Contents to appear on a page and to leave the global parameter set to true. To find an example of this, you can navigate to the Resume link that appears in the footer of this page. I have used Heading codes on this page to instantiate the Table of Contents that appears at the top of this page.

And “that’s all I have to say about that” …