gpt4 book ai didi

list - 列表中的代码片段(克里奥尔语维基)

转载 作者:行者123 更新时间:2023-12-01 06:44:48 26 4
gpt4 key购买 nike

虽然 Wikis and Wikipedia仍然在 51 区,我想问这个关于使用克里奥尔维基标记的问题。我有以下代码:

# 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. Initial instructions here.
2. Some instructions here. See code snippet below.
def foo():  return bar
1. More continuing instructions here. Why does the numbering restart at 1?
2. Final instructions.


问题:如何在列表中嵌入代码片段,以便代码片段下方的列表项不会从 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>

关于list - 列表中的代码片段(克里奥尔语维基),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6825433/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com