I'm trying to get some very simple pages to render properly with Jekyll using kramdown to process markdown and rouge for syntax highlighting. Kramdown appears to not interpret triple-backticks, however, even in GFM mode.
I believe I've followed the instructions to the letter, and things work out fine when pushed to github pages, but my local setup just ignores the backticks.
If it's any help, this has been observed on OS X with Jekyll 3.1.1. The command line used to invoke jekyll is jekyll serve --config "_config.yml"
.
I've narrowed the problem to the following minimal test:
_config.yml
markdown: kramdown
highlighter: rouge
kramdown:
input: GFM
index.md
---
layout: default
---
```scala
def test(i: Int): Unit = {
println(i)
}
```
layout/default.html
<!doctype html>
<html>
<body>{{ content }}</body>
</html>
Resulting index.html
<!doctype html>
<html>
<body><p>```scala
def test(i: Int): Unit = {
println(i)
}</p>
<p>```</p>
</body>
</html>
I suggest you to do like this. I tested your code block whit the following configuration and it worked fine:
config.yml
:Then, to your file
index.md
:Note: I've noticed that there was a space before
```scala
and it shouldn't be there.Then, run
jekyll serve
with bundler:Open your terminal and:
Install bundler:
gem install bundler
Update all your gems (if you want):
bundle update
Add a
Gemfile
(don't add any file extension) to your siteroot
and paste the code below into it. This is GitHub Pages recommended method.Go to your project root folder (on the terminal) and run:
bundle install
(this will make sure you have all required gems and their dependencies installed locally). AGemfile.lock
will be generated for you at your site root. Leave it there.Run
bundle exec jekyll serve --watch
to view your site locally athttp://localhost:4000
Done!
Let me know if this works for you, yeah?