diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..06aefd0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# ignore generated artifacts +/artifacts diff --git a/bibtexbrowser.after.php b/bibtexbrowser.after.php new file mode 100644 index 0000000..03098af --- /dev/null +++ b/bibtexbrowser.after.php @@ -0,0 +1,48 @@ +'2005')) + * $title is a string, the title of the section + */ + function search2html($query, $title) { + $entries = $this->db->multisearch($query); + if (count($entries)>0) { + echo "\n".'
'.$title.'
'."\n"; + } + $display = new NoHeaderDisplay(); + $display->setEntries($entries); + $display->display(); + + } + + function display() { + $this->db = createBibDataBase(); + $this->db->bibdb = $this->entries; + $this->yearIndex = $this->db->yearIndex(); + + foreach($this->yearIndex as $year) { + echo "\n".'
'.$year.'
'."\n"; + foreach (_DefaultBibliographySections() as $section) { + $this->search2html(array_merge(array(Q_YEAR=>$year), $section['query']),$section['title']); + } + } + } +} +?> \ No newline at end of file diff --git a/bibtexbrowser.german.php b/bibtexbrowser.german.php new file mode 100644 index 0000000..820e8ef --- /dev/null +++ b/bibtexbrowser.german.php @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/bibtexbrowser.local.php b/bibtexbrowser.local.php new file mode 100644 index 0000000..1b6f05d --- /dev/null +++ b/bibtexbrowser.local.php @@ -0,0 +1,34 @@ + \ No newline at end of file diff --git a/makehtml.sh b/makehtml.sh new file mode 100755 index 0000000..ff3aab5 --- /dev/null +++ b/makehtml.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# URL of the Bibtex file +BIBTEX_URL="https://cloud.hiz-saarland.de/public.php/dav/files/Yj8FtZsTS9TkFWG" +# command to run BibtexBrowser +BIBTEXBROWSER="php -c \"php_cli.ini\" -f \"bibtexbrowser.php\"" + +# DELETEME +rm -r "artifacts" "temp" +# create output directories and download bibtex file +mkdir -p "artifacts/keys" "temp" +wget -O "temp/zrd.bib" "$BIBTEX_URL" + +# if `bibtool` is available, sanitize the bibtex file +if which bibtool >/dev/null 2>&1 +then + bibtool "temp/zrd.bib" > "temp/zrd.new.bib" + echo "Bibtool successful!" + mv -f "temp/zrd.new.bib" "temp/zrd.bib" +fi + +# copy static files +cp -fur "static" "artifacts/" + +for WEBSITE_LANGUAGE in german +do : + # generate full index + eval "$BIBTEXBROWSER \"bib=temp/zrd.bib\" all display=YearCatDisplay language=$WEBSITE_LANGUAGE > \"artifacts/all.${WEBSITE_LANGUAGE}.html\"" + # generate index for each person + while read LINE + do : + ALIAS="$(echo "$LINE" | cut -d ':' -f 1)" + SEARCHSTRING="$(echo "$LINE" | cut -d ':' -f 2)" + eval "$BIBTEXBROWSER \"bib=temp/zrd.bib\" \"author=$SEARCHSTRING\" academic=1 language=$WEBSITE_LANGUAGE > \"artifacts/${ALIAS}.${WEBSITE_LANGUAGE}.html\"" + done < "persons.txt" +done + +# generate page for each key +egrep '^@' "temp/zrd.bib" | sed -e 's/.*\t \(.*\),/\1/' | while read KEY +do : + eval "$BIBTEXBROWSER \"bib=temp/zrd.bib\" \"key=$KEY\" > \"artifacts/keys/${KEY}.html\"" +done + +# Clean up +rm -rf "temp" +rm bibtexbrowser_*.dat \ No newline at end of file diff --git a/persons.txt b/persons.txt new file mode 100644 index 0000000..0a72e42 --- /dev/null +++ b/persons.txt @@ -0,0 +1,16 @@ +ajla:Ajla Hajric +anastasiia:Anastasiia Babych +andreas:Andreas Rebmann +anna:Anna Zichler +frederik:Frederik Möllers +greta:Greta Böttcher +jochen:Jochen Krüger +lina:Lina Nauerz +max:Maximilian Eichacker +natascha:Natascha Schliwinski +niklas:Niklas Dahlem +piotr:Piotr Rataj +simone:Simone Salemi +stephanie:Stephanie Vogelgesang +theresa:Theresa Moll +tim:Tim Schneider \ No newline at end of file diff --git a/php_cli.ini b/php_cli.ini new file mode 100644 index 0000000..0d30c02 --- /dev/null +++ b/php_cli.ini @@ -0,0 +1 @@ +auto_prepend_file = "prepend.php" \ No newline at end of file diff --git a/prepend.php b/prepend.php new file mode 100644 index 0000000..ccfac9a --- /dev/null +++ b/prepend.php @@ -0,0 +1,3 @@ + \ No newline at end of file