diff --git a/scripts/htdocs-helper/README.md b/scripts/htdocs-helper/README.md deleted file mode 100644 index 11e7df3cb5e..00000000000 --- a/scripts/htdocs-helper/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# JabRef helper tools - -## Helper scripts - -* [generate-htdocs-help-from-jabref-src-help](generate-htdocs-help-from-jabref-src-help) is a script generating the help files in `htdocs` based on the content from `src/main/resources/help` -* [validate-htdocs-syntax.pl](validate-htdocs-syntax.pl) is used for syntax checking of the `htdocs` repository. - -## Repository `htdocs` - -https://github.com/JabRef/htdocs is the git repository for the htdocs of http://jabref.sourceforge.net/. -It is uploaded manually to JabRef. - -`htdocs/images/es.png` and `us.png` are from the "Flag icons - http://www.famfamfam.com". -These icons are public domain, and as such are free for any use (attribution appreciated but not required). diff --git a/scripts/htdocs-helper/generate-htdocs-help-from-jabref-src-help.pl b/scripts/htdocs-helper/generate-htdocs-help-from-jabref-src-help.pl deleted file mode 100644 index aa8dda83f97..00000000000 --- a/scripts/htdocs-helper/generate-htdocs-help-from-jabref-src-help.pl +++ /dev/null @@ -1,302 +0,0 @@ -#!/usr/bin/perl -#requires: perl >= 5.10 - -#generate-htdocs-help-form-jabref-src-help.pl -#(c) 2012 Kolja Brix and Oliver Kopp - -#This scripts converts the help files -#from the source directory of JabRef (HELPDIR_JABREF) -#to help files for the web page (HELPDIR_WEB) - -#Start it from the root directory of your git repository. -# Windows: perl generate-htdocs-help-form-jabref-src-help.pl -#It will overwrite all help files in HELPDIR_WEB -#It will NOT delete files in HELPDIR_WEB which were removed in HELPDIR_JABREF - -#There are NO command line parameters - -#If you have newline issues at the generated files, -#adapt FORCE_WINDOWS_NEWLINES - - -#Error: -#Use of uninitialized value in concatenation (.) or string at generate-htdocs-help-from-jabref-src-help.pl line 174, <$infileH> line 138. -#Reason: -#A new language has been added to HELPDIR_JABREF, where no translation is contained in -#%translation_back_to_contents. Please add the language to there. - -use constant HELPDIR_JABREF => "../src/main/resources/help"; -use constant HELPDIR_WEB => "../../htdocs/help"; - -#0 for normal operationrequired -#1 for cygwin's perl -use constant FORCE_WINDOWS_NEWLINES => 0; - -#translations for "Back to contents" -our %translation_back_to_contents = ( - "da" => "Back to contents", - "de" => "Zurück zum Inhaltsverzeichnis", - "en" => "Back to contents", - "fr" => "Retour au contenu", - "in" => "Kembali ke Daftar Isi", - "ja" => "目次に戻る" -); - - -#build.xml for getting string replacements ${version} and ${year} -use constant BUILDXML => "../build.xml"; - -use warnings; -use strict; - -#enable "given/when" -use feature ":5.10"; - -sub handleDir; -sub handleFile; -sub loadPreferences; - -our $jabref_version; -our $jabref_year; -our $jabref_placeholder_version; -our $jabref_placeholder_year; - -loadPreferences(); - -#Debug call for a single file -#handleFile("../src/main/resources/help/About.html", "../../htdocs/help/About.php", "en"); -#exit; - - -# handle English -handleDir(HELPDIR_JABREF, HELPDIR_WEB, "en"); - -#handle other languages (contained in sub directories) - -my $helpdirJabRef; - -opendir($helpdirJabRef, HELPDIR_JABREF) or die $!; - -my $sourcedir; -my $targetdir; -my $lang; - -while (my $subdir = readdir($helpdirJabRef)) { - $sourcedir = HELPDIR_JABREF . "/$subdir"; - next unless (-d $sourcedir); - next if ($subdir =~ /\.\.?/); - - $targetdir = HELPDIR_WEB . "/$subdir"; - $lang = $subdir; - - handleDir($sourcedir, $targetdir, $lang); -} -close($helpdirJabRef); - -exit 0; - - - -# Parameters: -# sourcedir -# targetdir -# language -sub handleDir { - my $sourcedir = shift; - my $targetdir = shift; - my $lang = shift; - - print("Handling $sourcedir...\n"); - - if (!-d $targetdir) { - mkdir($targetdir); - } - - my $dh; - opendir($dh, $sourcedir) or die $!; - while (my $infilename = readdir($dh)) { - next unless ($infilename =~ /\.html$/); - my $outfilename = $infilename; - $outfilename =~ s/\.html/\.php/g; - my $sourcefilename = $sourcedir . "/" . $infilename; - my $targetfilename = $targetdir . "/" . $outfilename; - handleFile($sourcefilename, $targetfilename, $lang); - } - close($dh); -} - -# -# Parameters: -# infilename: source file (html) -# outfile: target file (php) -# lang: language (ISO-format) -# -sub handleFile { - my $infilename = shift; - my $outfilename = shift; - my $lang = shift; - - my $replace_placeholders = ($infilename =~ /About.html$/); - - #Debug output - #print("handleFile:\n$infilename\n$outfilename\n$lang\n$replace_placeholders\n\n"); - - open(my $infileH, "<", $infilename) or die "cannot open < $infilename: $!"; - my @infile = <$infileH>; - - my @outfile=(); - - # Determine title out of first h1 heading - my $title=""; - my $line; - foreach $line(@infile) { - if ($line =~ /\