TASIOMIND.DEV — OPERATIONAL▸▸▸FULL STACK DEVELOPER @ GWQ SERVICEPLUS AG▸▸▸FOUNDER — K8SGPT.AI▸▸▸OPEN SOURCE: ACTIVE▸▸▸DISTRIBUTED SYSTEMS / KUBERNETES / AI▸▸▸RUST + GO + PYTHON▸▸▸FIELD TESTED / STATUS — NOMINAL▸▸▸LOCATION: EUROPE/BERLIN▸▸▸TASIOMIND.DEV — OPERATIONAL▸▸▸FULL STACK DEVELOPER @ GWQ SERVICEPLUS AG▸▸▸FOUNDER — K8SGPT.AI▸▸▸OPEN SOURCE: ACTIVE▸▸▸DISTRIBUTED SYSTEMS / KUBERNETES / AI▸▸▸RUST + GO + PYTHON▸▸▸FIELD TESTED / STATUS — NOMINAL▸▸▸LOCATION: EUROPE/BERLIN▸▸▸

How to use Redcarpet for syntax highlighting in Jekyll

February 23, 2017

why?

  • because i don't wanna use liquid tags. i want to keep my posts in pure markdown in case i need to switch platforms or use the posts elsewhere
  • because Github uses Redcarpet for rendering .md content
  • because it supports fenced code blocks.
  • because it makes working with imported/exported sites easy

install

code
sudo gem install redcarpet

configuration

In your _config.yml file, add the entry for redcarpet and update the value for markdown.

code
markdown: redcarpet

redcarpet:
  extension: [
      "no_intra_emphasis",
      "tables",
      "autolink",
      "strikethrough",
      "with_toc_data",
      "fenced_code_blocks", # ```javascript ```
      "highlight", # ==highlight==
      "superscript", # 2^(nd)
      "footnotes", # [^somesamplefootnote]

    ]