在Jekyll中使用pygments时如何支持滚动 [英] How to support scrolling when using pygments with Jekyll
本文介绍了在Jekyll中使用pygments时如何支持滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Jekyll中工作时,是否有可能在使用pygments突出显示的代码段中使用水平滚动而不是文本换行.
Is it possible to use horizontal scrolling rather than text wrapping in a code section highlughted with pygments when working in Jekyll.
文档来源:
{% highlight bash %}
Full thread dump OpenJDK Client VM (19.0-b09 mixed mode, sharing):
"Attach Listener" daemon prio=10 tid=0x0a482400 nid=0x5105 waiting on condition [0x00000000]
java.lang.Thread.State: RUNNABLE
....
{% endhighlight %}
生成的页面(请注意,十六进制地址被包装而不是滚动):
Generated page (Notice the hex address being wrapped rather than scrolled):
推荐答案
在以下位置找到您的highlight.css: /PROJECT_ROOT/assets/themes/THEME_NAME/css/highlight.css
Find your highlight.css at: /PROJECT_ROOT/assets/themes/THEME_NAME/css/highlight.css
并在末尾添加以下行:
pre { white-space: pre; overflow: auto; }
感谢@manatwork提供解决方案.
Thanks @manatwork for the solution.
这篇关于在Jekyll中使用pygments时如何支持滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文