# HG changeset patch # User kleing # Date 944735672 -3600 # Node ID 3c587e7b8fe51aef75321b4d9e400b26330a63a8 # Parent bb15396278fb6404ad0e4a05de27df5f884f8496 new webpage layout diff -r bb15396278fb -r 3c587e7b8fe5 Admin/page/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Admin/page/Makefile Thu Dec 09 11:34:32 1999 +0100 @@ -0,0 +1,67 @@ +# --- uses $DISTNAME environment variable + +# --- perl scripts used in this makefile + +GENPAGE = bin/genpage +MKCONTENT = bin/mkcontents + +# --- +# --- genpage stuff + +# --- directories for main isabelle pages + +MAIN_CONTENT = main-content +MAIN_LAYOUT = main-layout +MAIN_TARGET = main + +# --- directories for isabelle distribution pages + +DIST_CONTENT = dist-content +DIST_LAYOUT = dist-layout +DIST_TARGET = dist + +# --- name of genpage template file +TEMPLATE_NAME = template.html + +# --- +# --- doc content generation + +# --- location of the Contents file of the Isabelle documentation +DOC_CONTENT_FILE = ../../Distribution/doc/Contents + +# --- url prefixes for documentation links in main and dist dirs +DIST_DOCU_PREFIX = $(DISTNAME)/doc/ +MAIN_DOCU_PREFIX = dist/$(DISTNAME)/doc/ + +# --- target include files with documentation links +DOC_CONTENTS_MAIN = docu-contents.main +DOC_CONTENTS_DIST = docu-contents.dist + +# --- +# --- begin rules + +all: clean gen + +gen: main dist + +main: check + $(MKCONTENT) -p $(MAIN_DOCU_PREFIX) $(DOC_CONTENT_FILE) $(DOC_CONTENTS_MAIN) + $(GENPAGE) -t $(MAIN_LAYOUT)/$(TEMPLATE_NAME) -c $(MAIN_CONTENT) -o $(MAIN_TARGET) + + cd $(MAIN_TARGET); perl -pi -e "s/{ISABELLE}/$(DISTNAME)/g;" *.html + +dist: check + $(MKCONTENT) -p $(DIST_DOCU_PREFIX) $(DOC_CONTENT_FILE) $(DOC_CONTENTS_DIST) + $(GENPAGE) -t $(DIST_LAYOUT)/$(TEMPLATE_NAME) -c $(DIST_CONTENT) -o $(DIST_TARGET) + + cd $(DIST_TARGET); perl -pi -e "s/{ISABELLE}/$(DISTNAME)/g;" *.html + +clean: + rm -rf $(MAIN_TARGET) + rm -rf $(DIST_TARGET) + rm -rf $(DOC_CONTENTS_MAIN) + rm -rf $(DOC_CONTENTS_DIST) + rm -f `find . -name "*~" -type f` + +check: + @if [ "$(DISTNAME)" = "" ]; then echo "Error: \$$DISTNAME not set."; exit 1; fi diff -r bb15396278fb -r 3c587e7b8fe5 Admin/page/bin/genpage --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Admin/page/bin/genpage Thu Dec 09 11:34:32 1999 +0100 @@ -0,0 +1,423 @@ +#!/bin/sh +exec perl -x. $0 ${1+"$@"} +# +#!perl -w + +# Genpage - Webpage Generator. +# +# Copyright (C) Joe Vaughan 1998-1999 +# Some portions Copyright (C) Ronan Waide 1999 +# Some portions Copyright (C) Rocco Caputo 1999 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +$|=1; + +$version = "1.0b3"; + +# following fix for Mac Perl submitted by Dair Grant +# I shoulda thought of this, but I don't have a mac :) Thanks Dair. +# +# dair, construct a path procedurally +sub build_path +{ + + # Retrieve our parameters + # + my $thePath = $_[0]; + my $theItem = $_[1]; + + + + # If we're running on a Mac, munge the path/item/separator + # + if ($^O eq "MacOS") + { + $thePath =~ s/:$//; # Strip off trailing ':' + $theItem =~ s/^:$//; # Drop theItem == ':' + $pathDiv = ":"; # Use Mac separator + } + else + { + $pathDiv = "/"; # Use Unix separator + } + + + + # Return the path to the item + # + return($thePath . $pathDiv . $theItem); +} + + + +# Some handy variables. +$numfiles = 0; +$numcontentfiles = 0; +$numignoredfiles = 0; +$numskippedfiles = 0; +$numcpfiles = 0; +$numdirfiles =0; + +use Getopt::Std; +use File::Find; +use File::Copy 'cp'; + +# Current Working Dir. +$pwd = `pwd`; +chomp ($pwd); + +getopts('dt:c:o:fqhi:') || die "Invalid args, use $0 -h for help\n"; + +# $opt_d is debug flag +# $opt_t is template file. If not set, use standard template. +# $opt_c is content directory. If not set, use standard content dir. +# $opt_o is output dir, if not set, use standard output dir. +# $opt_q sets quiet mode (no stdout output) +# $opt_f sets a force flag - force generation even if output file is present +# and newer. +# $opt_h runs usage and exits + +# dair, build paths procedurally +$opt_t ||= build_path("", "layout") . build_path("", "template.html"); +$opt_c ||= build_path("", "content"); +$opt_o ||= build_path("", "www"); +$opt_f ||= 0; +$opt_d ||= 0; +$opt_q ||= 0; +$opt_h ||= 0; +$opt_i ||= 'CVS|.*,v$'; + +# dair, build paths procedurally +$opt_t = build_path($pwd, $opt_t); +$opt_c = build_path($pwd, $opt_c); +$opt_o = build_path($pwd, $opt_o); + + +if ($opt_h) { &usage; } + +if (!$opt_q) { + print "Genpage, version $version starting run...\n"; +} + +if ($opt_d) { print "pwd = $pwd\n"; } + +#Swallow template file whole... +open( TEMPLATE, "<$opt_t" ) || die "Can\'t open template file $opt_t: $!\n"; +{ +local $/; +undef $/; +$template =