X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=utils%2Fhelp2Website.java;h=6bb4dfcd5ad1f42d0a577747ca74e264c73f9642;hb=506d60f0e188723ddc91c26824b41ac7034df3fe;hp=d23e35af51049228f6ab05426fa37c86d9367d02;hpb=e495c90121c15f8c7d716ad002c3333e3d73a733;p=jalview.git diff --git a/utils/help2Website.java b/utils/help2Website.java index d23e35a..6bb4dfc 100755 --- a/utils/help2Website.java +++ b/utils/help2Website.java @@ -1,95 +1,113 @@ -import java.io.*; -import java.util.*; - -public class help2Website -{ - - 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"); - - BufferedReader in = new BufferedReader(new FileReader(jhm)); - - 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; - - - st = new StringTokenizer(line, "\""); - st.nextToken(); //")!=-1) - indent.setLength(indent.length()-18); - - if(line.indexOf(""+indent+"" - +text - +""); - else - out.println("
"+indent+text); - - - if(line.indexOf("/>")==-1) - indent.append("   "); - - } - - out.println("\n"); - - - 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"); - } - } - - -} \ No newline at end of file +/* + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4) + * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ +import java.io.*; +import java.util.*; + +public class help2Website +{ + + 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"); + + BufferedReader in = new BufferedReader(new FileReader(jhm)); + + 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; + + + st = new StringTokenizer(line, "\""); + st.nextToken(); //")!=-1) + indent.setLength(indent.length()-18); + + if(line.indexOf(""+indent+"" + +text + +""); + else + out.println("
"+indent+text); + + + if(line.indexOf("/>")==-1) + indent.append("   "); + + } + + out.println("\n"); + + + 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"); + } + } + + +}