2011-07-26 3 views
4

Wikis and Wikipedia이 아직 51 지역에있는 동안 Creole 위키 마크 업 사용에 관해이 질문을하고 싶습니다. 그 코드를 구문 분석 할 때목록 내의 코드 스 니펫 (크리올 위키)

# 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(): 
    return bar 
1. 여기에서 더 많은 지침을 계속하십시오. 번호가 1에서 다시 시작하는 이유는 무엇입니까?
2. 최종 지침.

질문 : 코드 스 니펫 아래 목록 항목이 1에서 다시 시작되지 않도록 목록에 코드 스 니펫을 포함시키는 방법은 무엇입니까?

+0

혹시이 알아낼 했습니까? – glopes

답변

0

인라인 미리 서식이 지정된 텍스트는 목록에서 작동합니다. 이를 사용하여 각 행을 분리하여 블록 사전 형식화를 근사값으로 지정할 수 있습니다. 이것은 훌륭한 해결책은 아니지만 일부 경우에는 효과가있을 수 있습니다.

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