8

I'm using Octopress for blogging, but I still haven't quite grasped the difference, if any, between "liquid extension"-style code blocks, using {% codeblock %}, and the more normal markdown-looking code blocks, using backticks, as well as the variations provided my kramdown and other markdown converters. That is:

{% codeblock haskell %}
main = putStrLn "Hello world"
-- liquid style
{% endcodeblock %}

vs.

```haskell
main = putStrLn "Hello world"
-- backtick fencing style (GitHub-flavored)
```

vs.

~~~ haskell
main = putStrLn "Hello world"
-- kramdown's tilde fencing
~~~

vs.

    main = putStrLn "Hello world"
    -- another kramdown style, I think
{:lang="haskell"}

etc.

Octopress provides the {% codeblock %} and backtick versions as "plugins", and they seem to support the same stuff: syntax highlighting, filenames for the code block, URL, etc.

I haven't gotten the kramdown-specific ones to work properly, I think because they depend on coderay or something, which I downloaded but couldn't get to work.

Anyway, here's my question:

Is there any reason to prefer one syntactic style over the other? On the one hand, I like the backtick fencing because it's GitHub-flavored markdown, which I'm used to and which seems "simpler", but on the other hand, the liquid syntax seems more "native" to Octopress.

Any thoughts would be much appreciated. At the moment, my posts have a random combination of styles, and I'd really like to streamline them into one style.

Steven Penny
  • 82,115
  • 47
  • 308
  • 348

1 Answers1

6
{% codeblock haskell %}
main = putStrLn "Hello world"
-- liquid style
{% endcodeblock %}

requires Liquid

```haskell
main = putStrLn "Hello world"
-- backtick fencing style (GitHub-flavored)
```

is not "portable"

~~~ haskell
main = putStrLn "Hello world"
-- kramdown's tilde fencing
~~~

is my choice

    main = putStrLn "Hello world"
    -- another kramdown style, I think
{:lang="haskell"}

is outdated

Steven Penny
  • 82,115
  • 47
  • 308
  • 348
  • Thanks - that helps. Unfortunately, I still can't get coderay syntax highlighting to work with Octopress + kramdown `~~~` fencing. I added the relevant parts to `_config.yml` as well as a `_coderay.scss` style sheet, but no dice. Is there anything special I have to do to get this working? – Brian Buccola Mar 06 '13 at 15:02
  • Nevermind - figured it out. The trick was to install coderay using `bundle` rather than directly with `gem`. – Brian Buccola Mar 06 '13 at 15:19