列表中的代码片段并防止在 Creole wiki 中重新开始编号
我有以下代码:
# Initial instructions here.
# Some instructions here. See code snippet below.
{{{
#!python
def foo():
return bar
}}}
# More instructions here. Why does the numbering restart at 1?
# Final instructions.
解析该代码时,我会得到以下内容:
1.此处为初始说明。
2. 这里有一些说明。请参阅下面的代码片段。def foo(): 返回栏 1. 更多后续说明请参见此处。为什么编号从 1 重新开始?
2. 最后说明。
问题:如何在列表中嵌入代码片段,以便代码片段下方的列表项不会从 1 重新开始?
I have the following code:
# Initial instructions here.
# Some instructions here. See code snippet below.
{{{
#!python
def foo():
return bar
}}}
# More instructions here. Why does the numbering restart at 1?
# Final instructions.
When that code is parsed, I'd get the following:
1. Initial instructions here.
2. Some instructions here. See code snippet below.def foo(): return bar1. More continuing instructions here. Why does the numbering restart at 1?
2. Final instructions.
Question: How do I embed code snippets within a list so that the list items below the code snippet won't restart at 1?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
内联预格式化文本适用于列表。您可以使用它通过分隔每一行来近似块预格式化。这不是一个很好的解决方案,但它可能适用于某些情况。
产量:
Inline preformatted text works in lists. You can use this to approximate block preformatting by separating each line. This isn't a great solution, but it might work for some cases.
Yeilds: