Subject: Re: supporting-cast international
To: None <www@netbsd.org, netbsd-docs@netbsd.org>
From: Jan Schaumann <jschauma@netmeister.org>
List: netbsd-docs
Date: 01/21/2002 16:56:09
--YiEDa0DAkWCtVeE4
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de> wrote:
 
> htdocs/index.html is updated manually, but with data output by "make" in
> htdocs/Changes. I guess that "make" could update ../index.html as well. 
 
> well, i wouldn't make .../NEWS a new file in the repository - it's really
> just temporary data. (I think i once even had "update htdocs/index.html
> on 'make' in htdocs/Changes" implemented, but can't find the code any
> more... it's not that difficult anyways, though)

What do you think about the attached script to generate index.html from
Changes/index.html and gallery/events.html ?

It uses only one tmp-file, which is cleaned up after index.html is
generated...

The Makefile-logic is a bit messy and could certainly be improved, I
guess.

-Jan

-- 
finger jschauma@netmeister.org

--YiEDa0DAkWCtVeE4
Content-Type: application/x-sh
Content-Disposition: attachment; filename="makeindex.sh"
Content-Transfer-Encoding: quoted-printable

#!/bin/sh=0A#=0A# $NetBSD: makeindex.sh,v 1.0 2002/01/21 16:27:57 jschauma =
Exp $=0A#=0A# update index.html with NEWS and EVENTS from /htdocs/Changes/i=
ndex.html and=0A# /htdocs/gallery/events.html=0A=0A# insert the head=0Ased =
-e '/<!-- NEWS::START -->/q' index.html > index.tmp=0A=0A# links to anchors=
 on that page are new, trim grep's separator and only print=0A# the first 8=
 links (each links is two lines)=0Agrep -B 1 'href=3D"#' Changes/index.html=
 | sed -e '/^--/d' | sed -e '17,$d' >> index.tmp=0A=0A# insert the middle p=
art=0Ased -e '/<!-- NEWS::END -->/!d' -e '/<!-- NEWS::END -->/bt=0A:t=0A/<!=
-- NEWS::END -->/,/<!-- EVENTS::START -->/ {=0A	/<!-- EVENTS::START -->/! {=
=0A		$! {=0A			N;=0A			bt=0A		}=0A	}=0A}=0A' index.html >> index.tmp=0A=0A#=
 links to anchors on that page are events, if we encounter "--" it means th=
at=0A# Upcoming Events is over (grep had to jump) and we can stop.  Only ad=
d at=0A# most 6 events (each event is two lines)=0Agrep -B1 'href=3D"#' gal=
lery/events.html | sed -e '/^--/ {=0Ad=0Aq=0A}' | sed -e '13,$d' >> index.t=
mp=0A=0A# insert the tail=0Ased -e '/<!-- EVENTS::END -->/!d' -e '/<!-- EVE=
NTS::END -->/bt=0A:t=0A/<!-- EVENTS::END -->/,$ {=0A	$! {=0A		N;=0A		bt=0A	=
}=0A}' index.html >>index.tmp=0A=0A# put in place=0Amv -f index.tmp index.h=
tml=0A
--YiEDa0DAkWCtVeE4--