I am trying to contribute some documentation to an open source project, so I'm trying to locally preview the documentation pages, which are part of a github website. But, my code blocks are not being formatted correctly. I have created a minimal example:
_config.yml
markdown: kramdown
highlighter: rouge
kramdown:
input: GFM
hard_wrap: false
parse_block_html: true
name: test
default.html
<!doctype html>
<html>
<body>{{ content }}</body>
</html>
auth.md
---
layout: default
---
## Authentication
Some description.
```scala
case class User(id: Long, name: String)
// defined class User
```
The resulting output from jekyll build
is
<!doctype html>
<html>
<body><h2 id="authentication">Authentication</h2>
<p>Some description.</p>
<div class="language-scala highlighter-rouge"><span class="k">case</span> <span class="k">class</span> <span class="nc">User</span><span class="o">(</span><span class="n">id</span><span class="k">:</span> <span class="kt">Long</span><span class="o">,</span> <span class="n">name</span><span class="k">:</span> <span class="kt">String</span><span class="o">)</span>
<span class="c1">// defined class User
</span></div>
</body>
</html>
This results in one long line of unformatted code. On the github site (which you can see here http://http4s.org/docs/0.15/auth.html), the html has <pre>
and <code>
elements. Like this:
<div class="language-scala highlighter-rouge"><pre class="highlight"><code><span class="k">...
Since other people do not have this problem previewing the site locally, and I have the same trouble previewing http://typelevel.org/cats/, I assume it is some local configuration issue of some sort. However, I haven't been able to figure anything out. This is my first time using jekyll/kramdown, so I have no experience to leverage.
I have the github-pages
gem installed, which has given me jekyll 3.3.1
and kramdown 1.11.1
.