0
votes

Can someone help me to get my code block (by prettify plugin) and headline seperated? I googled a lot but didn't find solution. I have written a blog in jekyll and used prettify plugin to highlight code. Below configuration is there in my config.yml file

markdown: kramdown
highlighter: pygments
redcarpet:
extensions: ["no_intra_emphasis", "fenced_code_blocks", "autolink", "tables", "with_toc_data"]

kramdown:
input: GFM
use_coderay: true
auto_ids: true
footnote_nr: 1
entity_output: as_char
toc_levels: 1..6
smart_quotes: lsquo,rsquo,ldquo,rdquo
enable_coderay: false

I am not able to post my image so please check the below URL for my .md file snippet
http://i.stack.imgur.com/yHroW.png

I expect headlines to be out of code block but Below is the output of my blog http://i.stack.imgur.com/BEqVE.png

1
Please post your relevant .md file snippet as code and not a screenshot - matrixanomaly

1 Answers

0
votes

If you want to highlight code in jekyll, this is useless to try a two years old plugin.

Just use hightlight tag :

{% highlight java %}
import java.toto;

public class ReadFile {
    public static void main(String[] args) throws IOException{
        String fileContents = readEntireFile("./foo.txt");
    }

... many more java code here

}
{% endhighlight %}

You will also need a style sheet. One can be found here and some more examples here.