Commit 46523b0d authored by Fabian Nuraddin Alexander Gabel's avatar Fabian Nuraddin Alexander Gabel 💬
Browse files

delete deprecated routines and corresponding tests

parent caa4c4dc
Pipeline #116684 passed with stages
in 53 seconds
#!/bin/bash
cd $RESEARCH_ROOT/build
cp -r $RESEARCH_ROOT/css $RESEARCH_ROOT/build
for f in *.md
do
pandoc --quiet --standalone $f -o "${f%.md}".html \
--mathjax \
-c css/base.css \
-c css/extra.css \
-c "css/print.css" \
-c "css/superfish.css" \
-c "css/superfish-vertical.css" \
-c "css/base_mode.css"
done
#!/bin/bash
# build the static webpage locally
BUILD_DIR=$RESEARCH_ROOT/build
DEPLOY_DIR=$RESEARCH_ROOT
BIN_DIR=$RESEARCH_ROOT/bin
# clean up directories
rm -rf $BUILD_DIR
rm -rf $DEPLOY_DIR/{.public,public}
#build Index
$BIN_DIR/preproc_topics.sh
$BIN_DIR/buildPandoc.sh
#make public directory and copy files
mkdir -p $DEPLOY_DIR/.public
cp -r $RESEARCH_ROOT/build/*.html $DEPLOY_DIR/.public
cp -r $RESEARCH_ROOT/img $DEPLOY_DIR/.public
cp -r $RESEARCH_ROOT/css $DEPLOY_DIR/.public
mv $DEPLOY_DIR/.public $DEPLOY_DIR/public
echo "Done. Visit file://$DEPLOY_DIR/public/index.html ."
#!/bin/bash
# building the a standalone static webpage
RESEARCH_BIN=$RESEARCH_ROOT/bin
RESEARCH_STATIC=$RESEARCH_ROOT/static
# Check commandline arguments
if [ $# -lt 1 ]
then
RESEARCH_DEPLOY=`pwd`
RESEARCH_TOPICS=`pwd`"/topics"
RESEARCH_BUILD=`pwd`"/build"
echo -e "No deploy directory was specified."
# clean up directories
rm -rf $RESEARCH_BUILD
rm -rf $RESEARCH_DEPLOY/{.public,public}
elif [ $# -lt 2 ]
then
RESEARCH_BUILD="$1"
RESEARCH_TOPICS=$RESEARCH_BUILD
RESEARCH_BUILD="$1/build"
echo -e "No extra topics directory was specified."
# clean up directories
rm -rf $RESEARCH_BUILD
rm -rf $RESEARCH_DEPLOY/{.public,public}
elif [ $# -lt 3 ]
then
RESEARCH_DEPLOY="$1"
RESEARCH_TOPICS="$2"
RESEARCH_BUILD="$1/build"
echo -e "No extra build directory was specified."
# clean up directories
rm -rf $RESEARCH_BUILD
rm -rf $RESEARCH_DEPLOY/{.public,public}
else
RESEARCH_DEPLOY="$1"
RESEARCH_TOPICS="$2"
RESEARCH_BUILD="$3"
fi
# prepare directories / clean-up
mkdir -p $RESEARCH_DEPLOY
mkdir -p $RESEARCH_BUILD
cp -vf $RESEARCH_TOPICS/*.md $RESEARCH_BUILD
echo -e "Deploying to $RESEARCH_DEPLOY ...;"
echo -e "Building into directory $RESEARCH_BUILD ..."
echo -e "Using .md-files from $RESEARCH_TOPICS ..."
# preprocess .md-files
echo "Preproc Topics"
$RESEARCH_BIN/preproc_topics.sh $RESEARCH_BUILD $RESEARCH_TOPICS
$RESEARCH_BIN/build_index.sh $RESEARCH_BUILD $RESEARCH_TOPICS
# build html files
echo "Creating HTML Files with pandoc"
$RESEARCH_BIN/create_html.sh $RESEARCH_BUILD
# replace markers
echo "Replacing markers"
$RESEARCH_BIN/replace_marker.sh $RESEARCH_BUILD
#make public directory and copy files
mkdir -p $RESEARCH_DEPLOY/.public
for f in $RESEARCH_BUILD/*_final.html
do
filename=$(basename -- "$f")
cp $f $RESEARCH_DEPLOY/.public/${filename%_final.html}.html
done
echo "Copying files to final destination ..."
cp -r $RESEARCH_ROOT/{img,css} $RESEARCH_DEPLOY/.public
mv -v $RESEARCH_DEPLOY/.public $RESEARCH_DEPLOY/public
echo "Done. Visit file://$RESEARCH_DEPLOY/public/index.html ."
#!/bin/bash
# build the static webpage locally
BUILD_DIR=$RESEARCH_ROOT/static/build
DEPLOY_DIR=$RESEARCH_ROOT/static
BIN_DIR=$RESEARCH_ROOT/bin
# clean up directories
rm -rf $BUILD_DIR
rm -rf $DEPLOY_DIR/{.public,public}
# preprocess .md-files
echo "Preproc Topics"
$BIN_DIR/preproc_topics.sh $RESEARCH_ROOT/static $RESEARCH_ROOT/topics
# get full TUHH staff pages ready for insertion
mkdir -p $RESEARCH_ROOT/static/build/plain
cp $RESEARCH_ROOT/static/home/*.html $RESEARCH_ROOT/static/build/plain
cp $RESEARCH_ROOT/static/forschung/*.html $RESEARCH_ROOT/static/build/plain
# build html files
echo "Run Pandoc"
$BIN_DIR/integrate_pandoc.sh
echo "Pandoc finished."
#make public directory and copy files
mkdir -p $DEPLOY_DIR/.public
for f in $BUILD_DIR/*_final.html
do
filename=$(basename -- "$f")
cp $f $DEPLOY_DIR/.public/${filename%_final.html}.html
done
cp -r $RESEARCH_ROOT/img $DEPLOY_DIR/.public
cp -r $RESEARCH_ROOT/css $DEPLOY_DIR/.public
mv $DEPLOY_DIR/.public $DEPLOY_DIR/public
echo "Done. Visit file://$DEPLOY_DIR/public/index.html ."
#!/bin/bash
# build the files for tuhh-delivery, review apps and deployment locally
#
# Structure
#
# tuhh-build/
# ├── forschung
# │ ├── aa/forschung.html
# │ ├── cm/forschung.html
# │ ├── dm/forschung.html
# │ ├── nm/forschung.html
# │ ├── st/forschung.html
# | └── topics
# | ├── img
# | │ ├── BO_BDO.jpg
# | │ ├── controlimex.png
# | │ └── webpage-example.png
# | ├── topic.html
# | └── Zemke_Hessenberg.html
# ├── home
# │ ├── ataraz.html
# │ ├── cseifert.html
# │ └── ymogge.html
#
#
# Check commandline arguments
PROJECT_PATH=""
if [ $# -lt 1 ]
then
RESEARCH_DEPLOY=$RESEARCH_ROOT/build-tuhh
PROJECT_ROOT="" #standard if webpage is deployed at root
elif [ $# -lt 2 ]
then
RESEARCH_DEPLOY=$1
PROJECT_ROOT=""
elif [ $# -lt 3 ]
then
RESEARCH_DEPLOY=$1
PROJECT_ROOT=$2
else
RESEARCH_DEPLOY=$1
PROJECT_ROOT=$2 # full path
PROJECT_PATH=$3 # path without web root
fi
echo "Deploying to $RESEARCH_DEPLOY."
echo "Using PROJECT_ROOT=$PROJECT_ROOT"
RESEARCH_BIN=$RESEARCH_ROOT/bin
RESEARCH_STATIC=$RESEARCH_ROOT/static
RESEARCH_BUILD=$RESEARCH_ROOT/build
rm -rf $RESEARCH_BUILD $RESEARCH_DEPLOY
mkdir -p $RESEARCH_BUILD $RESEARCH_DEPLOY $RESEARCH_DEPLOY/include
echo "Preprocessing Topics..."
$RESEARCH_BIN/preproc_topics.sh "$RESEARCH_BUILD" \
"$RESEARCH_ROOT/topics" \
"$RESEARCH_BUILD/home" \
"$RESEARCH_BUILD/forschung" \
"$PROJECT_ROOT" >> $RESEARCH_BUILD/build.log 2>&1
# build index files
#cp $RESEARCH_BUILD/index.md $RESEARCH_DEPLOY
$RESEARCH_BIN/build_index.sh $RESEARCH_DEPLOY/forschung/topics $RESEARCH_ROOT/topics >> $RESEARCH_BUILD/build.log 2>&1
$RESEARCH_BIN/create_html.sh $RESEARCH_DEPLOY/forschung/topics \
$RESEARCH_DEPLOY/forschung/topics \
TUHH >> $RESEARCH_BUILD/build.log 2>&1
rm $RESEARCH_DEPLOY/forschung/topics/index.md
#
$RESEARCH_BIN/build_index.sh $RESEARCH_DEPLOY $RESEARCH_ROOT/topics forschung/topics/ >> $RESEARCH_BUILD/build.log 2>&1
$RESEARCH_BIN/create_html.sh $RESEARCH_DEPLOY \
$RESEARCH_DEPLOY \
TUHH >> $RESEARCH_BUILD/build.log 2>&1
rm $RESEARCH_DEPLOY/index.md
# build html files
echo "Creating HTML Topics with pandoc..."
#topics
$RESEARCH_BIN/create_html.sh $RESEARCH_BUILD/forschung/topics \
$RESEARCH_BUILD \
TUHH >> $RESEARCH_BUILD/build.log 2>&1
# include ssi directives
echo "Inserting SSI-directives..."
$RESEARCH_BIN/replace_ssi_marker.sh $RESEARCH_DEPLOY/forschung/topics \
$RESEARCH_BUILD/forschung/topics \
$PROJECT_PATH >> $RESEARCH_BUILD/build.log 2>&1
#delete <h1> tag
$RESEARCH_BIN/postproc_topics.sh $RESEARCH_DEPLOY/forschung/topics
echo "Creating HTML Snippets for Staff..."
#staffpages
$RESEARCH_BIN/create_html.sh $RESEARCH_DEPLOY/home \
$RESEARCH_BUILD/home \
TUHH >> $RESEARCH_BUILD/build.log 2>&1
$RESEARCH_BIN/postproc_snippets.sh $RESEARCH_DEPLOY/home
# wg pages
echo "Creating HTML Snippets for WG..."
for wg in aa cm dm nm st
do
$RESEARCH_BIN/create_html.sh $RESEARCH_DEPLOY/forschung/$wg \
$RESEARCH_BUILD/forschung/$wg \
TUHH >> $RESEARCH_BUILD/build.log 2>&1
$RESEARCH_BIN/postproc_snippets.sh $RESEARCH_DEPLOY/forschung/$wg
done
# readme
echo "Creating Readme..."
$RESEARCH_BIN/build_README.sh $RESEARCH_STATIC/misc/TUHH_BUILD_README.md \
$RESEARCH_DEPLOY/ \
>> $RESEARCH_BUILD/build.log 2>&1
echo "Copying files..."
cp -r $RESEARCH_ROOT/topics/img $RESEARCH_DEPLOY/forschung/topics
cp -r $RESEARCH_STATIC/include/{css,javascript,images} $RESEARCH_DEPLOY/include
# replace {include} in html
mkdir -p $RESEARCH_DEPLOY/include/html
for f in $RESEARCH_STATIC/include/html/*.html
do
filename=$(basename -- "$f")
sed -e "s;{project_root};$PROJECT_ROOT;" $f > $RESEARCH_DEPLOY/include/html/$filename
done
cp $RESEARCH_STATIC/ssi/htaccess $RESEARCH_DEPLOY/.htaccess
# XBitHack (cf. https://httpd.apache.org/docs/current/mod/mod_include.html)
chmod +x $RESEARCH_DEPLOY/forschung/topics/*.html
chmod +x $RESEARCH_DEPLOY/include/html/*.html
echo "Done."
echo "Start apache by running the command"
echo " docker run -it --rm --name apache-server -p 8080:80 -v $RESEARCH_DEPLOY:/usr/local/apache2/htdocs/ eltenedor/alpine-www3-dev:latest"
echo "Then visit localhost:8080 in your web browser."
echo "Alternatively review file://$RESEARCH_DEPLOY/index.html in your web browser."
#!/bin/bash
namelist=`grep -h -i -m 1 -r "###\s*Collaborators (MAT):" topics/topic-template.md | sed -e 's/^###\s*Collaborators (MAT):\s*//I' -e 's/\s*,\s*/\n/g' | sort -u`
for name in $namelist
do
# pipeline to get full name of staff-member from mat-homepage
# -> wget the staff homepage of $name
# -> grep the line with the <h1>-tag, something like <h1>Fabian Gabel, M. Sc.</h1><div class='staffIntro'><p><img src='/home/fgabel/images/portrait.png' title='Foto von Fabian Gabel, M. Sc.' class='staffPicture'></p><div class='staffContact'>
# -> strip the string such that only the portion between <h1></h1> remains
# -> remove leading spaces
echo "Found collaborator $name"
# replace name in .md file
echo "- pandoc --standalone ./build/$name.md -o ./build/$name.html --mathjax" >> out.yml
done
#!/bin/bash
# processing command line arguments
# more than a wrapper for pandoc
# create_html.sh [RESEARCH_BUILD] [RESEARCH_TOPICS]
# [RESEARCH_BUILD] Where the htmls are created
# [RESEARCH_TOPICS] where the .mds for translation are located
# Define variables
# Check commandline arguments
if [ $# -lt 1 ]
then
RESEARCH_BUILD=`pwd`"/build"
RESEARCH_TOPICS=`pwd`
echo -e "No building directory was specified."
BUILD_SUFFIX="_research"
elif [ $# -lt 2 ]
then
RESEARCH_BUILD="$1"
RESEARCH_TOPICS=$RESEARCH_BUILD
BUILD_SUFFIX="_research"
echo -e "No extra topics directory was specified."
elif [ $# -lt 3 ]
then
RESEARCH_BUILD="$1"
RESEARCH_TOPICS="$2"
BUILD_SUFFIX="_research"
else
RESEARCH_BUILD="$1"
RESEARCH_TOPICS="$2"
BUILD_SUFFIX=""
fi
RESEARCH_BIN=$RESEARCH_ROOT/bin
mkdir -p $RESEARCH_BUILD
echo -e "Building into directory $RESEARCH_BUILD ..."
echo -e "Using .md-files from $RESEARCH_TOPICS ..."
# specify URL to avoid use of local library
# see https://docs.mathjax.org/en/latest/web/start.html#ways-of-accessing-mathjax
# and https://www.jsdelivr.com/package/npm/mathjax
# create plain _research.html to be integrated into other files
for f in $RESEARCH_TOPICS/*.md
do
echo $f
$RESEARCH_BIN/run_pandoc.sh $f $RESEARCH_BUILD $BUILD_SUFFIX
done
#!/bin/bash
# get_static.sh
# deprecated, but retained as parts of it may still be useful
# Preprocessor for staff keys in .md topic file
# Replaces key fgabel by "Fabian Gabel, M.Sc." according to Webpage content
# If Build_dir is passed, titles are appended to corresponding files
......
#!/bin/bash
if [ $# -lt 1 ]
then
RESEARCH_BUILD=$RESEARCH_ROOT/static/build
echo -e "No building directory was specified."
else
RESEARCH_BUILD="$1"/build
fi
mkdir -p $RESEARCH_BUILD
echo -e "Building into directory $RESEARCH_BUILD ..."
cd $RESEARCH_BUILD
# specify URL to avoid use of local library
# see https://docs.mathjax.org/en/latest/web/start.html#ways-of-accessing-mathjax
# and https://www.jsdelivr.com/package/npm/mathjax
MATHJAX_URL='https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'
# create plain _research.html to be integrated into other files
for f in *.md
do
pandoc $f -o "${f%.md}"_research.html \
--mathjax=$MATHJAX_URL \
-c css/base.css \
-c css/extra.css \
-c "css/print.css" \
-c "css/superfish.css" \
-c "css/superfish-vertical.css" \
-c "css/base_mode.css"
done
# replace "MARKER" in .html files with research topics
for f in $RESEARCH_ROOT/static/build/plain/*html
do
filename=$(basename -- "$f")
sed -e "/MARKER/r $RESEARCH_ROOT/static/build/${filename%.html}_research.html" -e '/MARKER/d' $RESEARCH_ROOT/static/build/plain/$filename > "${filename%.html}"_final.html
done
# Building standalone topics and index
for f in $RESEARCH_ROOT/topics/*.md $RESEARCH_BUILD/index.md
do
filename=$(basename -- "$f")
sed -e "/MARKER/r $RESEARCH_ROOT/static/build/${filename%.md}_research.html" -e '/MARKER/d' $RESEARCH_ROOT/static/topic/topic-template.html > "${filename%.md}"_final.html
done
#!/bin/bash
# post_proc_snippets.sh [PROJECT_ROOT]
# apply styling to html snippets
# replace h2 by div
if [ $# -lt 1 ]
then
PROJECT_ROOT=`pwd`
else
PROJECT_ROOT=$1
fi
for f in $PROJECT_ROOT/*.html
do
sed -i -e "s;<h2\(.*\)>\(.*\)</h2.*>;<div\1>\2</div>;g" $f
done
#!/bin/bash
# post_proc_topics.sh [PROJECT_ROOT]
# apply styling to html snippets
# delete h1 tag as it gets already included by ssi-directive in sidebar.html
if [ $# -lt 1 ]
then
PROJECT_ROOT=`pwd`
else
PROJECT_ROOT=$1
fi
for f in $PROJECT_ROOT/*.html
do
sed -i "/<h1.*<\/h1>/d" $f
done
#!/bin/bash
RESEARCH_BUILD="$RESEARCH_ROOT/build"
mkdir -p $RESEARCH_BUILD
baseurl='https://www.mat.tuhh.de'
full_filename="$RESEARCH_ROOT/index.md"
filename=$(basename -- "$full_filename")
#make output copy
echo "Preprocessing $filename..."
cp $full_filename $RESEARCH_BUILD/$filename
# delete disclaimer about automatic processing
sed -i -e '/PROCESSED AUTOMATICALLY/ d' $RESEARCH_BUILD/$filename
#replace working group
echo "Replacing working group keys..."
namelist=`grep -h -i -m 1 -r "###\s*Working Groups:" $RESEARCH_BUILD/$filename | sed -e 's/^###\s*Working Groups:\s*//I' -e 's/\s*,\s*/\n/g' | sort -u`
echo "Found the following keys: " $namelist
for wg in $namelist
do
fullname=`wget -qO- $baseurl/forschung/$wg | grep h1 | sed -e "s;<h1>\s*\(.*\)</h1>.*$;\1;g" | sed -e 's;^[ \t]*;;'`
echo "Found working group $fullname"
echo "# $fullname" > $RESEARCH_BUILD/$wg.md
# append research to staffiles
echo -e "\n$title\n" >> $RESEARCH_BUILD/$wg.md
sed -i "s;### Working Groups:\(.*\)$wg\(.*\);### Working Groups:\1\[$fullname\]($wg.html)\2;g" $RESEARCH_BUILD/$filename
#sed -i "s;### Working Groups:\(.*\)$wg\(.*\);### Working Groups:\1\[$fullname\]($baseurl/forschung/$wg)\2;g" $RESEARCH_BUILD/$filename #uncomment this line for linking the mat.tuhh.de webpage
#initialize wg file
echo "# $fullname" > $RESEARCH_BUILD/$wg.md
done
echo "Replacing collaborator keys..."
namelist=`grep -h -i -m 1 -r "###\s*Collaborators (MAT):" $RESEARCH_BUILD/$filename | sed -e 's/^###\s*Collaborators (MAT):\s*//I' -e 's/\s*,\s*/\n/g' | sort -u`
echo "Found the following keys: " $namelist
for name in $namelist
do
# pipeline to get full name of staff-member from mat-homepage
# -> wget the staff homepage of $name
# -> grep the line with the <h1>-tag, something like <h1>Fabian Gabel, M. Sc.</h1><div class='staffIntro'><p><img src='/home/fgabel/images/portrait.png' title='Foto von Fabian Gabel, M. Sc.' class='staffPicture'></p><div class='staffContact'>
# -> strip the string such that only the portion between <h1></h1> remains
# -> remove leading spaces
wget -qO- $baseurl/home/$name/?homepage_id=$name > page.html
iconv -f WINDOWS-1252 -t UTF-8 ./page.html > ./utf.html
fullname=`grep h1 ./utf.html | sed -e "s/<h1>\s*\(.*\)<\/h1>.*$/\1/g" | sed -e 's/^[ \t]*//'`
echo "Found collaborator $fullname"
# replace name in .md file
sed -i "s;$name;\[$fullname\]($name.html);g" $RESEARCH_BUILD/$filename
#sed -i "s;$name;\[$fullname\]($baseurl/home/$name);g" $RESEARCH_BUILD/$filename #uncomment this line for linking the mat.tuhh.de webpage
#initialize staff file
echo "# $fullname" > $RESEARCH_BUILD/$name.md
done
# adpat img path (prefix a dot)
sed -i "s;\](/img/;\](./img/;g" $RESEARCH_BUILD/$filename
#!/bin/bash
RESEARCH_BUILD="$RESEARCH_ROOT/build"
mkdir -p $RESEARCH_BUILD
baseurl='https://www.mat.tuhh.de'
for f in $RESEARCH_ROOT/topics/*.md
do
echo $f
filename=$(basename -- "$f")
#make output copy
echo "Preprocessing $filename..."
cp $f $RESEARCH_BUILD/$filename
#extract title of topic
title="## `head -n 1 $RESEARCH_BUILD/$filename | sed -e "s;#\s*;\[;g" -e "s;\(.*\);\1\](${filename%.md}.html);g"`"
# prepare index
# append research topic to index
echo "Creating index.md ..."
echo -e "\n$title\n" >> $RESEARCH_BUILD/index.md
#replace working group
echo "Replacing working group keys..."
namelist=`grep -h -i -m 1 -r "###\s*Working Groups:" $RESEARCH_BUILD/$filename | sed -e 's/^###\s*Working Groups:\s*//I' -e 's/\s*,\s*/\n/g' | sort -u`
echo "Found the following keys: " $namelist
for wg in $namelist
do
#extract full name from tuhh-webpage
fullname=`wget -qO- $baseurl/forschung/$wg | grep h1 | sed -e "s;<h1>\s*\(.*\)</h1>.*$;\1;g" | sed -e 's;^[ \t]*;;'`
echo "Found working group $fullname"
# append research to staffiles
echo -e "\n$title\n" >> $RESEARCH_BUILD/$wg.md
sed -i "s;### Working Groups:\(.*\)$wg\(.*\);### Working Groups:\1\[$fullname\]($wg.html)\2;g" $RESEARCH_BUILD/$filename
#sed -i "s;### Working Groups:\(.*\)$wg\(.*\);### Working Groups:\1\[$fullname\]($baseurl/forschung/$wg)\2;g" $RESEARCH_BUILD/$filename #uncomment this line for linking the mat.tuhh.de webpage
done
echo "Replacing collaborator keys..."
namelist=`grep -h -i -m 1 -r "###\s*Collaborators (MAT):" $RESEARCH_BUILD/$filename | sed -e 's/^###\s*Collaborators (MAT):\s*//I' -e 's/\s*,\s*/\n/g' | sort -u`
echo "Found the following keys: " $namelist
for name in $namelist
do
# pipeline to get full name of staff-member from mat-homepage
# -> wget the staff homepage of $name
# -> grep the line with the <h1>-tag, something like <h1>Fabian Gabel, M. Sc.</h1><div class='staffIntro'><p><img src='/home/fgabel/images/portrait.png' title='Foto von Fabian Gabel, M. Sc.' class='staffPicture'></p><div class='staffContact'>
# -> strip the string such that only the portion between <h1></h1> remains
# -> remove leading spaces
wget -qO- $baseurl/home/$name/?homepage_id=$name > page.html
iconv -f WINDOWS-1252 -t UTF-8 ./page.html > ./utf.html
fullname=`grep h1 ./utf.html | sed -e "s/<h1>\s*\(.*\)<\/h1>.*$/\1/g" | sed -e 's/^[ \t]*//'`
echo "Found collaborator $fullname"
# replace name in .md file
sed -i "s;$name;\[$fullname\]($name.html);g" $RESEARCH_BUILD/$filename
#sed -i "s;$name;\[$fullname\]($baseurl/home/$name);g" $RESEARCH_BUILD/$filename #uncomment this line for linking the mat.tuhh.de webpage
# append research to staffiles
echo -e "\n$title\n" >> $RESEARCH_BUILD/$name.md
done
# adpat img path (prefix a dot)
sed -i "s;\](/img/;\](./img/;g" $RESEARCH_BUILD/$filename
done
#!/bin/bash
# processing command line arguments
# Check commandline arguments
# Description: Preprocessor for keys in topics files
# Replace keys for staffmembers and working groups
#
# preproc_topics.sh [RESEARCH_BUILD] [RESEARCH_TOPICS] [RESEARCH_STAFF] [RESEARCH_WG] [RESEARCH_TUHH]
#
# #1 [RESEARCH_BUILD] where the files are built
# #2 [RESEARCH_TOPICS] where the plain topic files are
# #3 [RESEARCH_STAFF] staffpages
# #4 [RESEARCH_WG] working groups pages
# #5 [RESEARCH_TUHH] optional argument toggling tuhh_build with structure as on webpage
#
RESEARCH_TUHH="" #default value
if [ $# -lt 1 ]
then
RESEARCH_BUILD=`pwd`"/build"
RESEARCH_STAFF=$RESEARCH_BUILD #directory for staff and wg files
RESEARCH_TOPICS=`pwd`
RESEARCH_STAFF=$RESEARCH_BUILD
RESEARCH_WG=$RESEARCH_STAFF
echo -e "No building directory was specified."
elif [ $# -lt 2 ]
then
RESEARCH_BUILD="$1"
RESEARCH_TOPICS=$RESEARCH_BUILD
RESEARCH_STAFF=$RESEARCH_BUILD
RESEARCH_WG=$RESEARCH_STAFF
echo -e "No extra topics directory was specified."
elif [ $# -lt 3 ]
then
RESEARCH_BUILD="$1"
RESEARCH_TOPICS="$2"
RESEARCH_STAFF=$RESEARCH_BUILD
RESEARCH_WG=$RESEARCH_STAFF
elif [ $# -lt 4 ]
then
RESEARCH_BUILD="$1"
RESEARCH_TOPICS="$2"
RESEARCH_STAFF="$3"