Author: dylan
Date: 2004-12-29 11:55:32 -0500 (Wed, 29 Dec 2004)
New Revision: 448

Modified:
   trunk/web/
   trunk/web/Makefile
   trunk/web/bin/fixhtml
   trunk/web/clients/
   trunk/web/clients/haver-gtk/
   trunk/web/clients/haver-net/
   trunk/web/download.thtml
   trunk/web/index.thtml
   trunk/web/templates/config
   trunk/web/templates/macros/html
   trunk/web/templates/sidebar
Log:
Various fixups.



Property changes on: trunk/web
___________________________________________________________________
Name: svn:ignore
   + *.html


Modified: trunk/web/Makefile
===================================================================
--- trunk/web/Makefile  2004-12-29 12:27:08 UTC (rev 447)
+++ trunk/web/Makefile  2004-12-29 16:55:32 UTC (rev 448)
@@ -1,12 +1,12 @@
 
 T         = templates
-DEPENDS  = $T/init $T/config bin/tt bin/fixhtml Makefile
+DEPENDS  = $T/init $T/config bin/tt bin/fixhtml $I/macros/html
 
 PERL5LIB  = ./lib
 
 
 TTFLAGS    = -I $T -P init -P config
-FIXFLAGS   = -R
+FIXFLAGS   = -R --noext
 RSYNCFLAGS = -vaz --exclude '.svn'
 TIDYFLAGS  = -q
 
@@ -44,19 +44,15 @@
        validate $(html)
 
 
-%.tmp: %.thtml
+%.html: %.thtml
        @echo "TT   $<"
        @$(TT) $(TTFLAGS) $< > $@
        @echo "FIX  $@"
        @$(FIX) $(FIXFLAGS) $@
-       
-
-%.html: %.tmp $(DEPENDS)
        @echo "TIDY $@"
-       @$(TIDY) $(TIDYFLAGS) $< > $@
+       @$(TIDY) $(TIDYFLAGS) -m $@
 
 
-
 %.css: %.tcss $(GDEPENDS)
        @echo "TT   $<"
        @$(TT) $(TTFLAGS) $< > $@
@@ -72,5 +68,4 @@
 endif
 
 .SUFFIXES:
-.INTERMEDIATE: %.tmp
 .PHONY: build upload clean realclean check fullcheck dist stop validate fast

Modified: trunk/web/bin/fixhtml
===================================================================
--- trunk/web/bin/fixhtml       2004-12-29 12:27:08 UTC (rev 447)
+++ trunk/web/bin/fixhtml       2004-12-29 16:55:32 UTC (rev 448)
@@ -44,6 +44,8 @@
     'extension|ext!',
 );
 
+my $doc;
+
 foreach my $file (@ARGV) {
        die "$file is an absolute path!" if 
File::Spec->file_name_is_absolute($file);
        
@@ -67,7 +69,7 @@
        s{//<!\[CDATA\[\n}{<!--\n}sg;
        s{//\]\]>\n}{// -->}sg;
        
-       my $doc = $parser->parse($_);
+       $doc = $parser->parse($_);
 
        warn "Fixing <a> tags.\n" if $opt{verbose} > 0;
        foreach my $tag ($doc->getElementsByTagName('a', 1)) {
@@ -92,6 +94,8 @@
        open my $fh, ">$file" or die "Can't open $file for writing: $!";
        print $fh $doc->toString, "\n";
        close $fh;
+
+    $doc->dispose;
 }
 
 
@@ -100,7 +104,13 @@
        
        if (my $href = $tag->getAttribute('href')) {
                $href = rewrite_url($href, $file);
-               $tag->setAttribute(href => $href);
+        if ($href ne '.' or $href eq '') {
+            $tag->setAttribute(href => $href);
+        } else {
+            $tag->setTagName('span');
+            $tag->setAttribute(class => 'nonlink');
+            $tag->removeAttribute('href'); 
+        }
        }
 }
 
@@ -126,13 +136,16 @@
                        my ($w,$h) = imgsize($imgfile);
                        $tag->setAttribute(width  => $w);
                        $tag->setAttribute(height => $h);
-               }
+               } else {
+            print STDERR "No image file named $src\n" if $opt{verbose};
+        }
        }
 }
 sub rewrite_url {
        my ($url, $file) = @_;
        
        if (not $opt{relative}) {
+        print STDERR "Relative!\n";
                $url =~ s!^$opt{pattern}!$opt{root}!;
                return $url;
        } else {
@@ -148,11 +161,17 @@
                        $ret = File::Spec::Unix->abs2rel($url, "/$dirs");
                }
                if ($opt{verbose}) {
-                       print STDERR "f($url. /$dirs) == $ret\n";
+                       print STDERR "f('$url', '/$dirs') == '$ret'\n";
                }
         if (not $ret) {
-            $ret = "#";
+            $ret = '.';
+        } else {
+            if (not $opt{ext}) {
+                $ret =~ s/(index)?\.\w+$//;
+            }
         }
+
+
                return $ret;
        }
                
@@ -175,10 +194,6 @@
                 File::Spec->catfile(dirname(File::Spec->rel2abs($page)), 
$src));
         }
     };
-    if (not $opt{ext}) {
-        $file =~ s/\.\w+$//;
-    }
-
     return $file;
 }
 


Property changes on: trunk/web/clients
___________________________________________________________________
Name: svn:ignore
   + *.html



Property changes on: trunk/web/clients/haver-gtk
___________________________________________________________________
Name: svn:ignore
   + *.html



Property changes on: trunk/web/clients/haver-net
___________________________________________________________________
Name: svn:ignore
   + *.html


Modified: trunk/web/download.thtml
===================================================================
--- trunk/web/download.thtml    2004-12-29 12:27:08 UTC (rev 447)
+++ trunk/web/download.thtml    2004-12-29 16:55:32 UTC (rev 448)
@@ -47,6 +47,8 @@
 
 <h2>ViewSVN</h2>
 <p>
-A CGI interface to the subversion repository is available <a 
href="https://uvmonkey.no-ip.org/viewsvn/viewsvn.php?project=haver&amp;path=/";>here</a>.
+A CGI interface to the subversion repository is available
+<a 
href="https://uvmonkey.no-ip.org/viewsvn/viewsvn.php?project=haver&amp;path=/";>here</a>.
 </p>
+
 [% END %]

Modified: trunk/web/index.thtml
===================================================================
--- trunk/web/index.thtml       2004-12-29 12:27:08 UTC (rev 447)
+++ trunk/web/index.thtml       2004-12-29 16:55:32 UTC (rev 448)
@@ -15,8 +15,8 @@
 
 <ol>
        <li>It is a protocol that is:<ol>
-               <li>Fairly well <a href="/docs/protocol/">documented</a> </li>
-               <li>Easy to parse because it <a href="/why-not-xml">is not 
XML</a> </li>
+        <li>Fairly well <a href="/docs/">documented</a> </li>
+               <li>Easy to parse because it <a href="/why-not-xml.html">is not 
XML</a> </li>
        </ol></li>
        <li>It is a server written in perl using <a 
href="http://poe.perl.org/";>POE</a></li>
        <li>More than one client written in perl, most of which also use 
POE.</li>

Modified: trunk/web/templates/config
===================================================================
--- trunk/web/templates/config  2004-12-29 12:27:08 UTC (rev 447)
+++ trunk/web/templates/config  2004-12-29 16:55:32 UTC (rev 448)
@@ -9,11 +9,10 @@
        page.title     = 'Untitled Page'
        page.copyright = 'FREE'
        page.author    = 'Dylan William Hardison'
-       page.email     = '[EMAIL PROTECTED]'
+       page.email     = '[EMAIL PROTECTED]'
 ;
 
 
-USE Env = EnvHash;
 
 config.title = "The Haver Project";
 

Modified: trunk/web/templates/macros/html
===================================================================
--- trunk/web/templates/macros/html     2004-12-29 12:27:08 UTC (rev 447)
+++ trunk/web/templates/macros/html     2004-12-29 16:55:32 UTC (rev 448)
@@ -8,16 +8,14 @@
        END;
 
        SET out = "<a href=\"$href\">$name</a>";
-       SET url = href.replace('^/', Env.SITE_ROOT);
+    SET path = '/' _ template.name;
+    SET url  = href.replace('/(index\.html?)?', '');
 
-       path = Env.SITE_ROOT _ page.path;
-       
-       
-       UNLESS url.match('^(https?|ftps?|mailto|):');
-               IF url == path or url _ "index" == path or url _ '/' == path;
-                       out = "<span class=\"nonlink\">$name</span>";
-               END;
-       END;
+    #IF url.match('^/');
+       #       IF url == path or url == '/';
+       #               out = "<span class=\"nonlink\">$name</span>";
+       #       END;
+       #END;
 
        GET out;
 END;

Modified: trunk/web/templates/sidebar
===================================================================
--- trunk/web/templates/sidebar 2004-12-29 12:27:08 UTC (rev 447)
+++ trunk/web/templates/sidebar 2004-12-29 16:55:32 UTC (rev 448)
@@ -2,7 +2,7 @@
 
 <a href="https://gna.org/projects/haver/";>Project</a>
 <br />
-<a href="/clients">Clients</a>
+<a href="/clients/index.html">Clients</a>
 <br />
-<a href="/download">Download</a>
+<a href="/download/index.html">Download</a>
 <br />


Reply via email to