X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=utils%2Fhelp2Website.java;h=83e4b5f11ee6ff15cee9fdcb9bbccd657d7de73f;hb=ae5bc0b6ae9aa38f12fc980c5d2d7acb6123f5ba;hp=ef174c4b922472365cdef2e9be1b9b1b4b42b338;hpb=47168f025aefdaa044802bd5f8f510ffe43a4808;p=jalview.git
diff --git a/utils/help2Website.java b/utils/help2Website.java
index ef174c4..83e4b5f 100755
--- a/utils/help2Website.java
+++ b/utils/help2Website.java
@@ -1,6 +1,6 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
@@ -24,93 +24,87 @@ import java.util.*;
public class help2Website
{
- public static void main(String [] args)
- {
- String line = "";
- try{
- Hashtable targets = new Hashtable();
+ public static void main(String[] args)
+ {
+ String line = "";
+ try
+ {
+ Hashtable targets = new Hashtable();
- File toc = new File("helpTOC.xml");
- File jhm = new File("help.jhm");
+ File toc = new File("helpTOC.xml");
+ File jhm = new File("help.jhm");
- BufferedReader in = new BufferedReader(new FileReader(jhm));
+ BufferedReader in = new BufferedReader(new FileReader(jhm));
- PrintWriter out = new PrintWriter(new FileWriter("helpTOC.html"));
- out.println("
Jalview - Help \n"
- +"\n"
- +"Contents\n");
+ PrintWriter out = new PrintWriter(new FileWriter("helpTOC.html"));
+ out.println("Jalview - Help \n"
+ + "\n"
+ + "Contents\n");
+ StringTokenizer st;
+ StringBuffer indent = new StringBuffer();
+ String target, url, text;
+ while ((line = in.readLine()) != null)
+ {
+ if (line.indexOf("target") == -1)
+ continue;
- StringTokenizer st;
- StringBuffer indent = new StringBuffer();
- String target, url, text;
- while( (line = in.readLine()) != null)
- {
- if(line.indexOf("target")==-1)
- continue;
+ st = new StringTokenizer(line, "\"");
+ st.nextToken(); // ") != -1)
+ indent.setLength(indent.length() - 18);
- url = st.nextToken();
- targets.put(target, url);
- }
+ if (line.indexOf("")!=-1)
- indent.setLength(indent.length()-18);
+ st = new StringTokenizer(line, "\"");
+ st.nextToken();
- if(line.indexOf("" + indent + "" + text + "");
+ }
+ else
+ out.println("
" + indent + text);
- target = st.nextToken();
+ if (line.indexOf("/>") == -1)
+ indent.append(" ");
- if(targets.get(target)!=null)
- {
- out.println("
"+indent+""
- +text
- +"");
- }
- else
- out.println("
"+indent+text);
+ }
+ // Add Googletracker.
+ out.close();
- if(line.indexOf("/>")==-1)
- indent.append(" ");
+ }
- }
- // Add Googletracker.
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
- out.close();
-
- }
-
- catch(Exception ex)
- {
-
- ex.printStackTrace();
-
- System.out.println("\n"+line+"\n");
-
- System.out.println("Usage: move to Help directory. help2Website will read"
- +"\nhelpTOC.xml and help.jhm producing output helpTOC.html");
- }
- }
+ System.out.println("\n" + line + "\n");
+ System.out
+ .println("Usage: move to Help directory. help2Website will read"
+ + "\nhelpTOC.xml and help.jhm producing output helpTOC.html");
+ }
+ }
}