Skip to content

Commit e3a67ae

Browse files
committed
feature: added support for simple wiki image syntax.
1 parent e546deb commit e3a67ae

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

tutorial.css

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
div.thumb img.thumbimage {
2+
background-color: #FFFFFF;
3+
}
4+
5+
html .thumbimage {
6+
border: 1px solid #CCCCCC;
7+
}
8+
9+
img {
10+
vertical-align: middle;
11+
}
12+
13+
div.thumbinner {
14+
background-color: #F9F9F9;
15+
border: 1px solid #CCCCCC;
16+
font-size: 94%;
17+
overflow: hidden;
18+
padding: 3px !important;
19+
text-align: center;
20+
min-width: 100px;
21+
}
22+
23+
.thumbcaption {
24+
text-align: left;
25+
border: medium none;
26+
font-size: 94%;
27+
line-height: 1.4em;
28+
padding: 3px !important;
29+
}
30+
31+
div.tright {
32+
margin: 0.5em 1.3em 1.3em 1.4em;
33+
}
34+
35+
div.thumb {
36+
background-color: transparent;
37+
width: auto;
38+
}
39+
40+
div.tright, div.floatright, table.floatright {
41+
clear: right;
42+
float: right;
43+
}
44+
45+
.magnify {
46+
float: right;
47+
background: none repeat scroll 0 0 transparent !important;
48+
border: medium none !important;
49+
direction: ltr;
50+
}

utils/gen-html-index-en.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<head>
2626
<title>agentzh's Nginx Tutorials (version $ver)</title>
2727
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
28+
<link rel="stylesheet" href="tutorial.css"/>
2829
</head>
2930
<body><h2>agentzh's Nginx Tutorials (version $ver)</h2>
3031
<h3>Table of Contents</h3>

utils/wiki2html-en.pl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,16 @@ sub fmt_para {
116116
_EOC_
117117
}
118118

119+
$s =~ s{\[\[File:(.*?)\|thumb\|alt=(.*?)\]\]}
120+
{<div class="thumb tright">
121+
<div class="thumbinner" style="width:222px;">
122+
<img class="thumbimage" width="220" src="image/$1">
123+
<div class="thumbcaption">
124+
<div class="magnify">$2</div>
125+
</div>
126+
</div>
127+
</div>}g;
128+
119129
if ($s =~ /^== (.*?) ==$/) {
120130
my $title = $1;
121131
my $id = quote_anchor("$base-$title");

0 commit comments

Comments
 (0)