列表中的代码片段(克里奥尔wiki)



虽然wiki和Wikipedia还在51区,但我想问一个关于使用克里奥尔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重新启动?

内联预格式化文本适用于列表。您可以使用它通过分隔每一行来近似块预格式化。这不是一个很好的解决方案,但在某些情况下可能有效。

# 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.

让步:

<ol>
	<li>Initial instructions here.</li>
	<li>Some instructions here. See code snippet below.
	<ul>
		<li><tt>#!python</tt></li>
		<li><tt></tt></li>
		<li><tt>def foo():</tt></li>
		<li><tt>  return bar</tt></li>
	</ul></li>
	<li>More instructions here. Why does the numbering restart at 1?</li>
	<li>Final instructions.</li>
</ol>

最新更新