# Testing Online Code Syntax Highlighters for Blogs (2): highlight.js

Note: This post won’t make sense here. Refer to the original post.1

Now I know the reason for failing to make highlight.js work on my blog yesterday. It is because of Blogger’s dynamic view, which is the real thing that I’m going to give up using forever. For details, refer to my newer post.2

Thanks to Chris, I know more ways of embedding source code lists now.

Confucius said that we need to practice what we’ve learnt. So this is my sample usage of highlight.js.

In my previous post titled Fast Compilation and Execution of Source Code, I included the following sample makefile:

Note: See the note of making a makefile in the previous blog post. In order to include this list, I used Alex Gorbatchev’s SyntaxHighlighter to do this.

This template looks pretty, but there’s some inadequacies for me:

1. Makefile (and other popular languages as well) support
2. Multiple language syntax detection: For example, in the second source code list, I try to explain how to write the HTML code for including a source code list of another language (In this case, it’s makefile).

Unluckily, I can only get the background, but not the syntax highlighted. I don’t know the cause of the problem. Anyways, everyone should be able to do it on a simple web page, and I’ve achieved my aim: to know how to make use of highlight.js. We should treasure what we already have before seeking something new. Maybe I do too many things on this template. What’s below shows how it fails.

Code copied from the live demo of highlight.js.

1. Updated on 07/02/14 22:18:24 HKT.

2. Updated on 08/01/14 09:45:00 GMT.