Changeset 982 for trunk

Show
Ignore:
Timestamp:
07/10/07 13:01:04 (18 months ago)
Author:
aj
Message:

update wiki export script

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/doc/export-wiki.sh

    r801 r982  
    44 
    55export SERVER=http://www.opensc-project.org 
    6 export WIKI=openct/wiki 
     6export PROJECT=openct 
     7export WIKI=$PROJECT/wiki 
    78export XSL=export-wiki.xsl 
    89 
     
    2526wget -nv $SERVER/$WIKI/TitleIndex -O "$SRCDIR"/TitleIndex.tmp 
    2627 
    27 grep "\"/$WIKI/[^\"]*\"" "$SRCDIR"/TitleIndex.tmp \ 
     28sed -e "s#</li>#</li>\n#g" < "$SRCDIR"/TitleIndex.tmp \ 
     29        | grep "\"/$WIKI/[^\"]*\"" \ 
    2830        |sed -e "s#.*\"/$WIKI/\([^\"]*\)\".*#\1#g" \ 
    2931        > "$SRCDIR"/WikiWords.tmp 
     
    4547        -O "$SRCDIR"/trac.css 
    4648 
     49cat *.html |grep "<img src=\"/$PROJECT/attachment/wiki" \ 
     50        |sed -e 's/.*<img src="\/'$PROJECT'\/attachment\/wiki\/\([^"]*\)?format=raw".*/\1/g' \ 
     51        |sort -u |while read A 
     52do 
     53        B="`echo $A |tr / _`" 
     54        wget -nv "$SERVER/$PROJECT/attachment/wiki/$A?format=raw" -O $B 
     55        for C in *.html 
     56        do 
     57                sed -e 's#\/'$PROJECT'\/attachment\/wiki\/'$A'?format=raw#'$B'#g' -i $C 
     58        done 
     59done 
     60 
     61for A in *.html 
     62do 
     63        sed -e 's#href="/'$PROJECT'/wiki/\([^"]*\)"#href="\1.html"#g' \ 
     64                -i $A 
     65done 
     66 
    4767rm "$SRCDIR"/*.tmp