변경사항 (가장 최근의 "소소한 수정"부터)
(일반적인 수정)
-5,7 +5,7 |
** scale 을 생략하면 기본값은 10이다. |
** [[Vote매크로]] 참조 |
: |
{{{perl |
{{{#!vim perl |
sub MacroSubst { |
... |
### 다음 라인 추가 |
-15,7 +15,7 |
} |
}}} |
: |
{{{perl |
{{{#!vim perl |
# 다음 함수를 통채로 추가 |
sub MacroVote { |
my ($count, $scale) = @_; |
<vote(count[,scale])> 매크로 추가
- WikiX 에 있는 매크로를 흉내내다. (왜 창작은 못할까... -.-;)
- 사용법 - <vote(count[,scale])>
- count * scale 의 길이(픽셀 단위)의 막대가 그려진다
- scale 을 생략하면 기본값은 10이다.
- Vote매크로 참조
-
sub MacroSubst {
...
$txt =~ s/\&__LT__;vote\((\d+)(,(\d+))?\)&__GT__;/&MacroVote($1,$3)/gei;
return $txt;
}
-
sub MacroVote {
my ($count, $scale) = @_;
my $maximum = 1000;
$scale = 10 if ($scale eq '');
my $width = $count * $scale;
$width = $maximum if ($width > $maximum);
return "<table ".(($width)?"bgcolor=\"lightgrey\" ":"")
."width=\"$width\" style=\"border:1 solid gray;\">"
."<tr><td style=\"padding:0; border:none; font-size:8pt;\">$count"
."</td></tr></table>";
}
위키위키분류