4

While Wikis and Wikipedia is still in Area 51, I'd like to ask this question about using the Creole wiki markup. 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 bar
1. 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?

Kit
  • 30,365
  • 39
  • 105
  • 149

1 Answers1

0

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.

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

Yeilds:

<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>
John Cole
  • 153
  • 1
  • 8