Differences between revisions 1 and 5 (spanning 4 versions)
Revision 1 as of 2006-07-30 09:35:36
Size: 850
Editor: 127
Comment:
Revision 5 as of 2011-08-03 11:01:01
Size: 965
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
테이블등 많은 레코드를 다룰 경우, 번호가 자동으로 매겨지면 유용할 때가 많다. 일반 리스트는 nl 테그를 쓸 수 있겠지만, 테이블로 표현할 경우, 자동넘버링을 이용할 수 없다. 그 때, 이 테그를 쓰면 된다. 테이블등에서 많은 레코드를 다룰 경우, 번호가 자동으로 매겨지면 유용할 때가 많다. 일반 리스트는 nl 테그를 쓸 수 있겠지만, 테이블로 표현할 경우, 자동넘버링을 이용할 수 없다. 그 때, 이 테그를 쓰면 된다.
Line 7: Line 7:
[[Numbering])]] [[Numbering]]]
Line 15: Line 15:
[[Numbering]], [[Numbering]], [[Numbering]], <<Numbering>>, <<Numbering>>, <<Numbering>>,
Line 30: Line 30:
=== 설치방법 ===
설치된 위키인스턴스의 plugin/macro 에 위 이름의 파일을 생성한다.

자동 번호매기기 매크로

테이블등에서 많은 레코드를 다룰 경우, 번호가 자동으로 매겨지면 유용할 때가 많다. 일반 리스트는 nl 테그를 쓸 수 있겠지만, 테이블로 표현할 경우, 자동넘버링을 이용할 수 없다. 그 때, 이 테그를 쓰면 된다.

사용법

[[Numbering]]] 

예제

[[Numbering]], [[Numbering]], [[Numbering]],

1, 2, 3,

저 매크로가 나올 때마다, 증가된 숫자가 표시된다.

소스코드

Numbering.py

   1 def execute(macro, args):
   2     if not hasattr(macro.request, 'numbering'):
   3         macro.request.numbering = 0
   4     macro.request.numbering+=1
   5     return macro.formatter.rawHTML(str(macro.request.numbering))

설치방법

설치된 위키인스턴스의 plugin/macro 에 위 이름의 파일을 생성한다.


CategoryMacro

NumberingMacro (last edited 2011-08-03 11:01:01 by localhost)

web biohackers.net