[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]
Re: not expanding $(SOMETHING) in <import> or <fsview>[B
- From: Denis Barbier <nospam@thanx>
- Date: Fri, 9 Jul 1999 11:38:45 +0200 (CET)
On Thu, 8 Jul 1999, Davor Cengija wrote:
> It's OK now. But, including protected pass numbers in quotes
> will cause <protect> to ignore them. so, <protect pass=4-9>
> works, and <protect pass="4-9"> does not. I think wml should
> be fixed to accept the quotes in <protect> since many people
> surrounds every attribute with quotes. Just a thought.
I think so ;-)
> <fsview> could be useful for showing the source code of some
> files, and it generates the link to that file. It would be nice
> if <fsview> had more options (colors, width etc.)
Ok, try the patch (not tested).
Denis
--- wml_include/imp/fsview.src 1999/01/04 15:57:04 1.1.1.1
+++ wml_include/imp/fsview.src 1999/07/09 09:29:52
@@ -7,11 +7,17 @@
<define-tag fsview>
<preserve src>
+<preserve headercolor>
+<preserve bodycolor>
+<preserve width>
<preserve hl>
+<preserve hlcolor>
<set-var %attributes>
<:
- $path = "<get-var src>";
- $hl = "<get-var hl>";
+ $path = "<get-var src>";
+ $width = "<or <get-var width> 90%>";
+ $hl = "<get-var hl>";
+ $hlcolor = "<or <get-var hlcolor> #a02020>";
if ($hl =~ m|,|) {
@HL = split(',', $hl);
@@ -22,21 +28,21 @@
# some special colors
if ($path =~ m|\.html$|) {
- $col1 = "d0dfd0";
- $col2 = "e0f0e0";
+ $col1 = "<or <get-var headercolor> #d0dfd0>";
+ $col2 = "<or <get-var bodycolor> #e0f0e0>";
}
elsif ($path =~ m|\.wml$|) {
- $col1 = "dfc0c0";
- $col2 = "ffe0e0";
+ $col1 = "<or <get-var headercolor> #dfc0c0>";
+ $col2 = "<or <get-var bodycolor> #ffe0e0>";
}
else {
- $col1 = "d0d0d0";
- $col2 = "f0f0f0";
+ $col1 = "<or <get-var headercolor> #d0d0d0>";
+ $col2 = "<or <get-var bodycolor> #f0f0f0>";
}
- print "<table border=0 width=\"90%\\" cellpadding=10 cellspacing=0>\n";
+ print "<table border=0 width=\"$width\" cellpadding=10 cellspacing=0>\n";
print "<tr>\n";
- print "<td align=left bgcolor=\"#$col1\">\n";
+ print "<td align=left bgcolor=\"$col1\">\n";
if (-f $path) {
#
@@ -64,7 +70,7 @@
print "</td>\n";
print "</tr>\n";
print "<tr>\n";
- print "<td bgcolor=\"#$col2\" align=left>\n";
+ print "<td bgcolor=\"$col2\" align=left>\n";
print "<pre>\n";
open(FP, "<$path");
@@ -75,7 +81,7 @@
if ($hl ne "") {
foreach $mark (@HL) {
if (m|$mark|) {
- s|^|<b><font color=\"#a02020\">|;
+ s|^|<b><font color=\"$hlcolor\">|;
s|$|</font></b>|;
}
}
@@ -123,7 +129,7 @@
if ($hl ne "") {
foreach $mark (@HL) {
if (m|$mark|) {
- s|^|<b><font color=\"#a02020\">|;
+ s|^|<b><font color=\"$hlcolor\">|;
s|$|</font></b>|;
}
}
@@ -141,7 +147,11 @@
print "</tr>\n";
print "</table>\n";
:>
+<restore hlcolor>
<restore hl>
+<restore width>
+<restore bodycolor>
+<restore headercolor>
<restore src>
</define-tag>