rmaicle

Programming is an endless loop; it's either you break or exit.

Licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA).
You are free to copy, reproduce, distribute, display, and make adaptations but you must provide proper attribution. Visit https://creativecommons.org/ or send an email to info@creativecommons.org for more information about the License.

Redcarpet

Date: 2014-11-12 17:18:31 +0000

Redcarpet is a Ruby library for processing Markdown. It requires the Ruby binaries. If you are on a Windows machine like me you will need a Windows binaries installer. To see the steps on setting it up, take a look at Local GitHub Pages on Windows.

After installing the required software and if Redcarpet is not yet installed then execute the following commands. (Redcarpet 3.1.2 is the current version of this writing).

1
2
gem install redcarpet
redcarpet --version

One thing I like about Redcarpet is that it allows me to use the original Markdown syntax for embedding code blocks using the tilde or backtick character.

~~~ cpp
int main() {
    std::cout << "Hello world!" << std::endl;
    return 0;
}
~~~

The code above is displayed with syntax highlighting using pygments.

int main() {
    std::cout << "Hello world!" << std::endl;
    return 0;
}

I want to be able to show the reader the code on how to display a fenced code block with syntax highlighting. I will discuss it in Liquid.

  •  github pages
  •  markdown
  •  redcarpet