Lookup a reverse hostname (net.example.domain.sub.dom.ains) in a dictionary object where each level has one hostname part as the keys – or certain kinds of wildcards.
marked + highlight.js + pre tag finder = drop one script tag into your HTML to replace pre tags with their content rendered as Github-flavored markdown.