# HG changeset patch # User saskia-hiltemann # Date 1447682182 18000 # Node ID 42076db43d42148c288e89927361806fd5c76d8a # Parent 4e21ce7092690da9326d89add63170788c6cbf00 Fixed auto resizing plus various other minor bugs diff -r 4e21ce709269 -r 42076db43d42 createHTML.sh --- a/createHTML.sh Tue Oct 07 08:49:14 2014 -0400 +++ b/createHTML.sh Mon Nov 16 08:56:22 2015 -0500 @@ -1,6 +1,9 @@ +gbcount=0 + ## ## Create Cover Page ## +# Click here to download a copy of this iReport

function makeIntroPage ( ){ echo "Creating Intro Page" title="$1" @@ -20,9 +23,8 @@ iReport: ${title}


- Click here to view report

+ Click image to view report

\"loading

- Click here to download a copy of this iReport

" > $htmlout @@ -30,14 +32,86 @@ } ## +## Decompress archive fiels +## -> will detect archive formats: zip, tar, gzip, tar.gz, bzip2 +## -> input: path to archive +## -> files will be located in ${galaxypath}/archive_${fname}/ +## +function decompressArchive (){ + archive=$1 + + fname=`basename ${archive}` + fname=${fname%.dat} + ftype=`file $archive` + + if [[ ! -d ${galaxypath}/archive_${fname}/ ]] + then + mkdir ${galaxypath}/archive_${fname}/ + + #echo "archive type: `file $archive`" + # decompress archive + if [[ $ftype == *Zip* ]] + then + #echo "detected zip file" + cp $archive ${galaxypath}/archive_${fname}/${fname}.zip + wd=`pwd` + cd ${galaxypath}/archive_${fname}/ + unzip -q ${fname}.zip + rm ${fname}.zip + cd $wd + fi + if [[ $ftype == *tar* ]] + then + cp $archive ${galaxypath}/archive_${fname}/${fname}.tar + wd=`pwd` + cd ${galaxypath}/archive_${fname}/ + tar xf ${fname}.tar + rm ${fname}.tar + cd $wd + fi + if [[ $ftype == *gzip* ]] + then + cp $archive ${galaxypath}/archive_${fname}/${fname}.gz + gunzip ${galaxypath}/archive_${fname}/${fname}.gz + #ls ${galaxypath}/archive_${fname}/ + + # check for tar.gz + ftype=`file ${galaxypath}/archive_${fname}/${fname}` + if [[ $ftype == *tar* ]] + then + # turns out it was tar.gz + rm -Rf ${galaxypath}/archive_${fname}/* + ls ${galaxypath}/archive_${fname}/ + cp $archive ${galaxypath}/archive_${fname}/${fname}.tar.gz + + wd=`pwd` + cd ${galaxypath}/archive_${fname}/ + tar xzf ${fname}.tar.gz + cd $wd + fi + wait + rm -f ${galaxypath}/archive_${fname}/*.tar + rm -f ${galaxypath}/archive_${fname}/*.tar.gz + fi + if [[ $ftype == *bzip2* ]] + then + cp $archive ${galaxypath}/archive_${fname}/${fname}.gz + gunzip2 ${galaxypath}/archive_${fname}/${fname}.gz + fi + fi +} + +## ## Create HTML content for the tabs specified by user ## function makeTabContent ( ){ tab=$1 # name of current tab itemslist=$2 # list of all items + tracklist=$3 # genome browser tracks info contentline="" # HTML code for tab imgcount=0 # keep track of the number of images on the current tab - + iframename=`head -n 1 < /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1` + #iframename="test" for item in $itemslist do ## Parse items lists @@ -63,6 +137,12 @@ text=${text//==space==/ } text=${text//==colon==/:} text=${text//==comma==/,} + + text=${text//==braceopen==/(} + text=${text//==braceclose==/)} + text=${text//==cbraceopen==/{} + text=${text//==cbraceclose==/}} + text=${text//==slash==/\/} text=${text//==lt==/<} text=${text//==gt==/>} @@ -78,8 +158,8 @@ text=${text//\&r/\\n} text=${text//\&n/\\n} text=${text//\&c/:} - - + + ## convert markdown in textfield to html echo -e "$text" > mytext.md @@ -90,9 +170,8 @@ else # pandoc exists - echo "pandoc exists" - pandoc -o mytext.html mytext.md - pandoc -o standalone.html -s mytext.md + pandoc -f markdown -o mytext.html mytext.md + pandoc -f markdown -o standalone.html -s mytext.md #get css generated by pandoc and add as scoped attribute (HTML5) pandocstyle=`sed -n '/