Show
Ignore:
Timestamp:
01/19/05 02:05:07 (4 years ago)
Author:
whmoseley
Message:

Add inital code for indexing site and docs.

Meta name "section" is used to limit to a section. Search for "defaultcontents"

defaultcontents section=docs
defaultcontents section=devel ( only devel docs)
defaultcontents section=website ( only web site pages, excluding docs and devel_docs )

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/swish_website/bin/split.pl

    r1587 r1593  
    11#!/usr/bin/perl -w 
    22use strict; 
     3use warnings; 
    34use File::Find; 
    45 
    56my $dir = shift || die "failed to specify directory"; 
     7my $pat = qr!<h\d><a name="([^"]+)"></a>([^<]+)</h\d>!i; #" for vim 
     8 
     9 
     10if ( -f $dir ) { 
     11    warn "Indexing [$dir] as a single file\n"; 
     12    index_path( $dir ); 
     13    exit; 
     14} 
    615 
    716find( \&process_doc, $dir ); 
     
    1120 
    1221 
    13 my $pat = qr[<h\d><a name="([^"]+)">([^<]+)</a></h\d>]i; 
    1422 
    1523 
     
    3139    return if $dir =~ m!/graphics!; 
    3240 
     41    index_path( $path ); 
     42} 
     43 
     44sub index_path { 
     45    my ( $path ) = @_; 
    3346 
    3447    unless ( open( FH, "<$path" ) ) { 
    35         warn "Failed to open file [$path]\n"; 
     48        warn "Failed to open file - [$path]: $!\n"; 
    3649        return; 
    3750    } 
     
    4356sub index_doc { 
    4457    my ($name, $doc) = @_; 
     58 
    4559 
    4660 
     
    5569    $title ||= "Swish-e Documentation"; 
    5670 
    57     $title =~ s/^SWISH-Enhanced: //; 
     71    $title =~ s/^Swish-e :: //; 
    5872 
    5973