[Tools] Blog Code Highlight - a tool generating highlighted code with Pretty Print in Blogger

[Tool]
Blog Code Highlight
Version: 1.0.1 Beta

Introduction:
  When highlighting code in Blogger as following:
class MyClass
{
    private:
        int Counter;
        std::vector<int> mCountList;

    public:
        MyClass(void);
        
    public:
        void Show(void);
}

   The HTML code has to be generated manually in the post as follows:
<pre class="prettyprint lang-cpp">
class MyClass
{
    private:
        int Counter;
        std::vector&lt;int&gt; mCountList;

    public:
        MyClass(void);
        
    public:
        void Show(void);
}
</pre>

  It is easy to make a mistake with the wrong typing causes exception occurred and not convenient to modify if the code is in HTML or XML because of some symbols(<, >,  &) are the reserved characters in the markup languages. Those problems confused me while I tried to write the blog with code if I didn't use the highlighting code frequently. In order to solve this problem and improve the efficiency of writing blog, I developed this tool as follows to help me convert the code of languages Google Code-Prettify supported into HTML code. 

   In this post, I would like to introduce how to use this tool to get correct (so far) HTML code for the Blogger.

How to use:
  1. Goes to https://blog-code-highlight.appspot.com

  2. Type or paste the source code in the text area on the left-hand side.

  3. Choose the language type which supported by Google Code-Prettify listed as follows:
    list here.

  4. Choose the version of HTML if you want to generate the code in HTML5.

  5. Tick Show Line Number if you want to show line number in the code. In addition, the first line number can be specified.

  6. Copy the formatted code from the Outcome session and paste it into your blog.

[Click Here] goes to this tool.

[Reference]
  1. Google / code-prettify
  2. HTML Entities

PS. Sorry for the ads. I need to get some funds if the quota is running out.

No comments:

Post a Comment

Build docker image from multiple build contexts

Build docker image from multiple build contexts ...