mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 03:32:12 +00:00
Merge pull request #405 from holta/master
refresh-wiki-docs.sh was producing broken links so I overhauled it
This commit is contained in:
commit
e3cefc6a12
1 changed files with 44 additions and 57 deletions
|
@ -1,81 +1,68 @@
|
|||
#!/bin/bash -x
|
||||
# pull down repo wiki, and use to create offline docs
|
||||
|
||||
# pull down repo wiki (etc) to create offline docs
|
||||
|
||||
set -e
|
||||
source /etc/iiab/iiab.env
|
||||
REPONAME=iiab
|
||||
REPO=https://github.com/iiab
|
||||
WIKI=iiab-wiki
|
||||
TARGET_URL=/info
|
||||
WWWROOT=/library/www/html
|
||||
INPUT=/tmp/${WIKI}
|
||||
OUTPUT=/tmp/${WIKI}.out
|
||||
|
||||
# this script is located in the scritps/ directory in the local repo
|
||||
SCRIPTDIR=$(dirname $0)
|
||||
pushd $SCRIPTDIR
|
||||
DESTPATH=/library/www/html/info
|
||||
|
||||
rm -rf $INPUT
|
||||
rm -rf $OUTPUT
|
||||
mkdir -p $INPUT
|
||||
mkdir -p $OUTPUT
|
||||
mkdir -p $WWWROOT$TARGET_URL/html
|
||||
|
||||
git clone $REPO/$REPONAME.wiki.git $INPUT
|
||||
git clone https://github.com/iiab/iiab.wiki.git $INPUT
|
||||
|
||||
# To Do find more links to rewrite, especially after moving from xsce to iiab
|
||||
for f in `ls /tmp/${WIKI}`; do
|
||||
for f in `ls ${INPUT}`; do
|
||||
FTRIMMED=${f%.md}
|
||||
if [ $FTRIMMED = "Home" ]; then FTRIMMED=index; fi
|
||||
pandoc -s /tmp/${WIKI}/$f -o $OUTPUT/$FTRIMMED.html
|
||||
# make links refer to local directory
|
||||
sed -i -r "/.*#.*/ s|$REPO/$REPONAME/wiki/(.*)(#.*)\">|./\1.html\2\">|" $OUTPUT/$FTRIMMED.html
|
||||
sed -i -r "/.*#.*/! s|$REPO/$REPONAME/wiki/(.*)\">|./\1.html\">|" $OUTPUT/$FTRIMMED.html
|
||||
sed -i -e "s|http://schoolserver.org/faq|/info/html/FAQ.html|" $OUTPUT/$FTRIMMED.html
|
||||
sed -i -e "s|http://wiki.laptop.org/go/IIAB/FAQ|/info/html/FAQ.html|" $OUTPUT/$FTRIMMED.html
|
||||
sed -i -e "s|http://wiki.laptop.org/go/XS_Community_Edition/FAQ|/info/html/FAQ.html|" $OUTPUT/$FTRIMMED.html
|
||||
sed -i -e "s|http://FAQ.IIAB.IO|/info/html/FAQ.html|" $OUTPUT/$FTRIMMED.html
|
||||
sed -i -e "s|http://faq.iiab.io|/info/html/FAQ.html|" $OUTPUT/$FTRIMMED.html
|
||||
sed -i -e "s|https://github.com/xsce/xsce/blob/release-6.2/\(.*\)\.md\">|./\1.html\">|" $OUTPUT/$FTRIMMED.html
|
||||
sed -i -e "s|https://github.com/xsce/xsce/wiki/\(.*\)\">|./\1.html\">|" $OUTPUT/$FTRIMMED.html
|
||||
sed -i -e "s|wiki.laptop.org/go/IIAB/FAQ|box/info/html/FAQ.html|" $OUTPUT/$FTRIMMED.html
|
||||
sed -i -e "s|wiki.laptop.org/go/IIAB/Security|box/info/html/Security.html|" $OUTPUT/$FTRIMMED.html
|
||||
done
|
||||
|
||||
rsync -av $OUTPUT/ $WWWROOT$TARGET_URL
|
||||
rsync -av $OUTPUT/ $DESTPATH
|
||||
|
||||
# copy the faq and other things
|
||||
lynx -reload -source http://wiki.laptop.org/go/IIAB/FAQ > $WWWROOT$TARGET_URL/html/FAQ.html
|
||||
lynx -reload -source http://wiki.laptop.org/go/IIAB/Security > $WWWROOT$TARGET_URL/html/Security.html
|
||||
lynx -reload -source http://wiki.laptop.org/go/IIAB/local_vars.yml > $WWWROOT$TARGET_URL/html/local_vars.yml
|
||||
# download FAQ etc
|
||||
lynx -reload -source http://wiki.laptop.org/go/IIAB/FAQ > $DESTPATH/FAQ.html
|
||||
lynx -reload -source http://wiki.laptop.org/go/IIAB/Security > $DESTPATH/Security.html
|
||||
lynx -reload -source http://wiki.laptop.org/go/IIAB/local_vars.yml > $DESTPATH/local_vars.yml
|
||||
lynx -reload -source http://wiki.laptop.org/go/IIAB/local_vars_min.yml > $DESTPATH/local_vars_min.yml
|
||||
lynx -reload -source http://wiki.laptop.org/go/IIAB/local_vars_big.yml > $DESTPATH/local_vars_big.yml
|
||||
|
||||
# fetch the recent release notes
|
||||
lynx -reload -source https://github.com/XSCE/xsce/wiki/IIAB-6.2-Release-Notes> $WWWROOT$TARGET_URL/IIAB-6.2-Release-Notes.html
|
||||
lynx -reload -source https://github.com/XSCE/xsce/blob/release-6.2/ReleaseNotes6.0.md > $WWWROOT$TARGET_URL/ReleaseNotes6.0.html
|
||||
lynx -reload -source https://github.com/XSCE/xsce/blob/release-6.2/ReleaseNotes6.1.md> $WWWROOT$TARGET_URL/ReleaseNotes6.1.html
|
||||
# download older release notes
|
||||
lynx -reload -source https://github.com/XSCE/xsce/wiki/IIAB-6.2-Release-Notes > $DESTPATH/IIAB-6.2-Release-Notes.html
|
||||
lynx -reload -source https://github.com/XSCE/xsce/blob/release-6.2/ReleaseNotes6.0.md > $DESTPATH/ReleaseNotes6.0.html
|
||||
lynx -reload -source https://github.com/XSCE/xsce/blob/release-6.2/ReleaseNotes6.1.md > $DESTPATH/ReleaseNotes6.1.html
|
||||
|
||||
pushd $OUTPUT
|
||||
for f in `ls *Release*.md`; do
|
||||
# FTRIMMED=${f%.md}
|
||||
FTRIMMED=${f:0:-3}
|
||||
pandoc -s $f -o $WWWROOT$TARGET_URL/$FTRIMMED.html
|
||||
# make links refer to local directory
|
||||
sed -i -e "s|$REPO/$REPONAME/wiki/\(.*\)\">|./\1.html\">)|" $WWWROOT$TARGET_URL/$FTRIMMED.html
|
||||
sed -i -e "s|https://github.com/xsce/xsce/blob/release-6.2/\(.*\)\">|./\1.html\">)|" $WWWROOT$TARGET_URL/$FTRIMMED.html
|
||||
# make links refer to local items
|
||||
for f in `ls ${DESTPATH}`; do
|
||||
sed -i -r "s|https://github.com/iiab/iiab/wiki/([-.0-9A-z]*)|\1.html|g" $DESTPATH/$f
|
||||
|
||||
sed -i -e "s|https://github.com/xsce/xsce/blob/release-6.2/\(.*\)\.md\">|\1.html\">|g" $DESTPATH/$f
|
||||
sed -i -e "s|https://github.com/xsce/xsce/wiki/\(.*\)\">|\1.html\">|g" $DESTPATH/$f
|
||||
|
||||
sed -i -e "s|http://wiki.laptop.org/go/IIAB/FAQ|FAQ.html|g" $DESTPATH/$f
|
||||
sed -i -e "s|http://wiki.iiab.io/FAQ|FAQ.html|g" $DESTPATH/$f
|
||||
sed -i -e "s|http://FAQ.IIAB.IO|FAQ.html|g" $DESTPATH/$f
|
||||
sed -i -e "s|http://faq.iiab.io|FAQ.html|g" $DESTPATH/$f
|
||||
sed -i -e "s|http://schoolserver.org/FAQ|FAQ.html|g" $DESTPATH/$f
|
||||
sed -i -e "s|http://schoolserver.org/faq|FAQ.html|g" $DESTPATH/$f
|
||||
sed -i -e "s|http://wiki.laptop.org/go/XS_Community_Edition/FAQ|FAQ.html|g" $DESTPATH/$f
|
||||
|
||||
sed -i -e "s|http://wiki.laptop.org/go/IIAB/Security|Security.html|g" $DESTPATH/$f
|
||||
sed -i -e "s|http://wiki.iiab.io/Security|Security.html|g" $DESTPATH/$f
|
||||
|
||||
sed -i -e "s|http://wiki.laptop.org/go/IIAB/local_vars.yml|local_vars.yml|g" $DESTPATH/$f
|
||||
sed -i -e "s|http://wiki.iiab.io/local_vars.yml|local_vars.yml|g" $DESTPATH/$f
|
||||
|
||||
sed -i -e "s|http://wiki.laptop.org/go/IIAB/local_vars_min.yml|local_vars_min.yml|g" $DESTPATH/$f
|
||||
sed -i -e "s|http://wiki.iiab.io/local_vars_min.yml|local_vars_min.yml|g" $DESTPATH/$f
|
||||
|
||||
sed -i -e "s|http://wiki.laptop.org/go/IIAB/local_vars_big.yml|local_vars_big.yml|g" $DESTPATH/$f
|
||||
sed -i -e "s|http://wiki.iiab.io/local_vars_big.yml|local_vars_big.yml|g" $DESTPATH/$f
|
||||
done
|
||||
popd
|
||||
|
||||
#pushd /opt/iiab/iiab-admin-console/roles/console/files/help
|
||||
# fetch the embedded help pages from the admin console
|
||||
#for f in `ls .`; do
|
||||
# FTRIMMED=${f%.rst}
|
||||
# pandoc -s $f -o $WWWROOT$TARGET_URL/html/$FTRIMMED.html
|
||||
# # make links refer to local directory
|
||||
# sed -i -e "s|$REPO/$ADMINREPO/wiki/\(.*\)\">|./\1.html\">)|" $WWWROOT$TARGET_URL/html/$FTRIMMED.html
|
||||
#done
|
||||
#popd
|
||||
|
||||
#rm -rf $INPUT
|
||||
#rm -rf $OUTPUT
|
||||
|
||||
popd
|
||||
exit 0
|
||||
|
|
Loading…
Reference in a new issue