它沒有顯示源代碼的圍欄,因爲沒有源代碼。
如果不指定任何東西,然後它會使用:
<div class="highlighter-rouge"><pre class="highlight"><code>
Is this really how code should be represented?
Answer = NO!!!
</code></pre>
</div>
你總是要定製使用像highlighter-rouge
生成的類的輸出選項。
在另一方面,如果你指定語言:
~~~ html
<html>
<body>
<p>Is this really how code should be represented?</p>
<div>Answer = NO!!!</div>
</body>
</html>
~~~
那麼它會產生更多的spific造型:
<div class="language-html highlighter-rouge"><pre class="highlight"><code><span class="nt"><html></span>
<span class="nt"><body></span>
<span class="nt"><p></span>Is this really how code should be represented?<span class="nt"></p></span>
<span class="nt"><div></span>Answer = NO!!!<span class="nt"></div></span>
<span class="nt"></body></span>
<span class="nt"></html></span>
</code></pre>
</div>
如果您仍然無法看到任何默認的語法高亮,那麼包含這些類的css就會丟失,典型的Jekyll自帶_syntax-highlighting.scss
,它已經包含了它們,但是你可以使用你想要的配色方案,例如默認的主題使用這個:https://github.com/jekyll/minima/blob/master/_sass/minima/_syntax-highlighting.scss
或者你可以安裝任何你想要的高棉主題:https://github.com/jneen/rouge/tree/master/lib/rouge/themes
$ rougify foo.rb
$ rougify style monokai.sublime > syntax.css
什麼是理想的輸出創造圍欄代碼塊?你沒有指定任何語言,並沒有代碼,所以我沒有看到任何問題的方式工作 – marcanuy
我希望代碼有一個很好的圍欄結構,但(如圖所示)我目前的設置就好像它在行代碼中看起來很糟糕。 –
「好圍欄結構」是什麼意思? '柵欄'是_source_中的'〜'字符(或者某些變體中的字符),與原來的使用縮進代碼的Markdown規範不同(它有時可能有點難以用於複製/粘貼等) )。 – matt