如何在 reStructuredText 中包装一个长文字块? [英] How to wrap a long literal block in reStructuredText?
本文介绍了如何在 reStructuredText 中包装一个长文字块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个由一条长行组成的文字块.它当前显示为带有水平滚动条的单行块(如下面的文字块).您如何实现自动格式化以换行,以便在调整浏览器大小时动态换行?
I have a literal block consisting of a single long line. It is currently displayed as a single-line block with horizontal scrollbar (like the literal block below). How do you implement auto-formatting to wrap the line so it wraps dynamically when the browser is resized?
::
Long line that does not wrap...........................................................................................
推荐答案
这可以通过使用新样式覆盖默认 CSS 来实现:
This could be done by overriding the default CSS with a new style:
pre {
white-space: pre-wrap;
}
编辑主题的 CSS 文件以包含此指令,它应该可以正常工作.
Edit your theme's CSS file to include this directive and it should just work.
这篇关于如何在 reStructuredText 中包装一个长文字块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文