Skip to main content

Featured

Build docker image from multiple build contexts

Build docker image from multiple build contexts Building a docker image requires specifying a source of truth to include in the image from a local directory or a remote git repository. In the previous version, the docker BuildKit allows users to specify the build context from a single source of truth only. However, the engineers may need to have the context from different locations based on the type of files. For instance, icons, images or other resources that are not included in the same package, including the resource from other docker images. Fortunately, the Docker Buildx toolkit supports multiple build context flag for Docker 1.4. Let's learn how to use this new feature. The following list is a shortcut for jumping into a specific topic handy. What version of Docker is this tutorial targeting? How to specify the version of Dockerfile frontend? Ho

[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.

Comments

Popular Posts