}
end
-def replace_line(prefix, keyword, line)
+def replace_line(surround, keyword, line)
begin
contents = eval "$#{keyword}"
- line.sub!(/#{prefix}#{keyword}/, contents)
+ line.sub!(/#{surround}#{keyword}#{surround}/, contents)
rescue NameError
die "No `#{keyword}' found for substitution"
end
theme_file = File.open("themes/#{$theme}/skeleton.html").readlines
msg 2, "Read theme `#{$theme}'"
for line in theme_file
- while line =~ /~~~(\w+)/
+ while line =~ /~~~(\w+)~~~/
replace_line('~~~', $1, line)
end
end
html = $skeleton.collect { |l| l.clone }
images4js = final_images.collect { |img| "\"#{img}\"" }.join(', ')
for i in html
- i.sub!(/~~images/, images4js)
- i.sub!(/~~title/, File.basename(dir))
+ i.sub!(/~~images~~/, images4js)
+ i.sub!(/~~title~~/, File.basename(dir))
end
File.open("#{dest_dir}/index.html", "w").write(html)
<link rev="made" href="http://zarb.org/~gc/html/booh.html" />
<script language="JavaScript1.1" type="text/JavaScript">
-var images = new Array(~~images);
+var images = new Array(~~images~~);
var images_ary = new Array();
var images_loaded = new Array();
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>~~title</title>
- ~~~head_code
+ <title>~~title~~</title>
+ ~~~head_code~~~
</head>
-<body bgcolor="#FFFFFF" ~~~body_additions>
+<body bgcolor="#FFFFFF" ~~~body_additions~~~>
<table width="100%">
<tr>
<td width="10%"></td>
- <td width="1%">~~~button_first</td>
+ <td width="1%">~~~button_first~~~</td>
<td width="3%"></td>
- <td width="1%">~~~button_previous</td>
+ <td width="1%">~~~button_previous~~~</td>
<td></td>
- <td width="1%">~~~button_next</td>
+ <td width="1%">~~~button_next~~~</td>
<td width="3%"></td>
- <td width="1%">~~~button_last</td>
+ <td width="1%">~~~button_last~~~</td>
<td width="10%"></td>
</tr>
<tr>
<td align="center" colspan="9">
- ~~~image
+ ~~~image~~~
</td>
</tr>
<tr>
<td align="center" colspan="9">
- <font size="+1" ~~~caption_additions> </font>
+ <font size="+1" ~~~caption_additions~~~> </font>
</td>
</tr>
</table>
-~~~body_code
+~~~body_code~~~
<table width="100%">
<tr>
- <td align="center">~~~button_slideshow</td>
+ <td align="center">~~~button_slideshow~~~</td>
</tr>
</table>