我可以在Kramdown中关闭代码块吗? [英] Can I turn off code blocks in Kramdown?
问题描述
我可以关闭Jekyll中的代码块吗?这样会使我的.md文件更具可读性.
Can I turn off code blocks in Jekyll? It would make my .md files more readable.
对于内联HTML和包含,我都有这个问题.
I have this problem for inline HTML and also for includes.
我使用Jekyll创建网站,从不想要代码块.现在,我将样式放在HTML中,如下所示:
I use Jekyll to create websites and never want code blocks. Right now I'm putting styling inside of HTML like this:
<div class="coolclass" markdown = 1>
<div class="anotherClass">stuff </div>
I **love** markdown
</div>
除非删除缩进,否则<div class="anotherClass">stuff </div>
将被解释为代码块.
The <div class="anotherClass">stuff </div>
gets interpreted as a code block unless I remove the indenting.
<div class="coolclass" markdown = 1>
<div class="anotherClass">stuff </div>
I **love** markdown
</div>
我想只关闭代码块,因为我永远不会显示代码.
I'd like to just turn off code blocks since I won't ever be displaying code.
如果kramdown具有该选项,我认为jekyll可以在配置中设置它,如下所示:
If kramdown has that option I think jekyll can set it in config like this:
kramdown:
auto_id_stripping: true
enable_coderay: false
我通过阅读kramdown docs 来尝试使enable_coderay为false,但是没有这样做它.
I tried enable_coderay false by reading the kramdown docs, but that didn't do it.
推荐答案
使用两个空格而不是4个空格或制表符可解决大多数问题.但是,诸如"h1"(#title")之类的内容需要在一行的开头才能起作用.还不在那里...
Using two spaces instead of 4 spaces or a tab fixes most of the issues. However things like 'h1' ('#title') need to be at the beginning of a line to work. Not quite there yet...
我正在这样做:
{% capture includeGuts %}
{% include signup-guts.html %}
{% endcapture %}
{{ includeGuts | replace: ' ', ''}}
这篇关于我可以在Kramdown中关闭代码块吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!