xmltochm (windows)
Allan CORNET [Mon, 15 Jun 2009 08:41:12 +0000 (10:41 +0200)]
12 files changed:
scilab/CHANGES_5.2.X
scilab/modules/helptools/.gitignore
scilab/modules/helptools/help/en_US/xmltochm.xml [new file with mode: 0644]
scilab/modules/helptools/helptools.iss
scilab/modules/helptools/macros/xmltochm.sci
scilab/modules/helptools/macros/xmltoformat.sci
scilab/modules/helptools/src/BuildChm/BuildChm.vcproj
scilab/modules/helptools/src/java/org/scilab/modules/helptools/BuildDocObject.java
scilab/modules/helptools/tests/unit_tests/xmltochm.tst [new file with mode: 0644]
scilab/modules/helptools/tests/unit_tests/xmltochm.win.dia.ref [new file with mode: 0644]
scilab/modules/scicos/.gitignore
scilab/modules/scicos/scicos.iss

index 7162144..033f75b 100644 (file)
@@ -95,6 +95,8 @@ Online Help :
 =============
 
  - Sub-Chapters are now allowed (See SEP #24)
+ - xmltochm exports help to chm format (Windows)
+
 
 char encoding bugs :
 ====================
index 55c9d78..4a3261a 100644 (file)
@@ -2,6 +2,7 @@ master_en_US_help.xml
 master_fr_FR_help.xml
 master_pt_BR_help.xml
 javaHelp
+chm
 macros/xmlfiletohtml.sci
 bin
 src/c/helptools.def
diff --git a/scilab/modules/helptools/help/en_US/xmltochm.xml b/scilab/modules/helptools/help/en_US/xmltochm.xml
new file mode 100644 (file)
index 0000000..b3730d9
--- /dev/null
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2009 - DIGITEO - Allan CORNET
+ * 
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="xmltochm" xml:lang="en">
+  <info>
+    <pubdate>$LastChangedDate: 2008-03-14 11:58:09 +0100 (ven, 14 mar 2008)
+    $</pubdate>
+  </info>
+  <refnamediv>
+    <refname>xmltochm</refname>
+    <refpurpose>converts xml Scilab help files to Microsoft Compressed HTML format (Windows)</refpurpose>
+  </refnamediv>
+  <refsynopsisdiv>
+    <title>Calling Sequence</title>
+    <synopsis>xmltochm(dirs [,titles [,dir_language [default_language]]]]])</synopsis>
+  </refsynopsisdiv>
+  <refsection>
+    <title>Parameters</title>
+    <variablelist>
+      <varlistentry>
+        <term>dirs</term>
+        <listitem>
+          <para>vector of strings: a set of directory paths for which html
+          manuals are to be generated or <literal>[] </literal></para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>titles</term>
+        <listitem>
+          <para>vector of strings: titles associated to directory paths or
+          []</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>dir_language</term>
+        <listitem>
+          <para>vector of strings: languages associated to directory paths or
+          []</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>default_language</term>
+        <listitem>
+          <para>vector of strings: default languages associated to directory
+              paths or []. If an XML file is missing in the dir_language, it's
+              copied from the default_language.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refsection>
+  <refsection>
+    <title>Description</title>
+    <para>converts xml Scilab help files contained in a set of directories
+    into chm files.</para>
+    
+    <para>
+<ulink url="http://msdn.microsoft.com/en-us/library/ms669985(VS.85).aspx">Microsoft HTML Help Downloads (Windows)</ulink>
+    </para>
+  </refsection>
+  <refsection>
+    <title>Examples</title>
+    <programlisting role="example">
+
+
+// example_1/
+// `-- help
+//     |-- en_US
+//     |   |-- example_1_function_1.xml
+//     |   |-- example_1_function_2.xml
+//     |   `-- example_1_function_3.xml
+//     `-- fr_FR
+//         |-- example_1_function_1.xml
+//         |-- example_1_function_2.xml
+//         `-- example_1_function_3.xml
+//     `-- zh_TW
+//         |-- example_1_function_1.xml
+//         |-- example_1_function_2.xml
+//         `-- example_1_function_3.xml
+
+my_module_path = pathconvert(SCI+'/modules/helptools/examples/example_1',%f,%f)
+
+// Build the french help
+// =============================================================================
+my_french_help_dir    =  my_module_path+'/help/fr_FR';
+my_french_help_title  =  'Example 1 [fr_FR]';
+res = xmltochm(my_french_help_dir,my_french_help_title,'fr_FR');
+if MSDOS then
+ dos('start ' + res);
+end
+
+// Build the english help
+// =============================================================================
+my_english_help_dir   =  my_module_path+'/help/en_US';
+my_english_help_title =  'Example 1 [en_US]';
+res = xmltochm(my_english_help_dir,my_english_help_title,'en_US');
+if MSDOS then
+ dos('start ' + res);
+end
+
+// Build the chinese help
+// =============================================================================
+my_chinese_help_dir   =  my_module_path+'/help/zh_TW';
+my_chinese_help_title =  'Example 1 [zh_TW]';
+res = xmltochm(my_chinese_help_dir,my_chinese_help_title,'zh_TW');
+if MSDOS then
+ dos('start ' + res);
+end
+
+    </programlisting>
+  </refsection>
+  <refsection>
+    <title>See Also</title>
+    <simplelist type="inline">
+      <member>
+        <link linkend="help">help</link>
+      </member>
+      <member>
+        <link linkend="add_help_chapter">add_help_chapter</link>
+      </member>
+    </simplelist>
+  </refsection>
+</refentry>
index cf7e636..1ad70da 100644 (file)
 
 Source: bin\helptools.dll; DestDir: {app}\bin; Components: {#COMPN_SCILAB}
 Source: modules\{#HELPTOOLS}\jar\*.jar; DestDir: {app}\modules\{#HELPTOOLS}\jar; Components: {#COMPN_SCILAB}
-;
+
+#ifdef WITH_CHM
+Source: modules\{#HELPTOOLS}\chm\*.chm; DestDir: {app}\modules\{#HELPTOOLS}\chm; Components: {#COMPN_SCILAB}
+#endif
 
 Source: modules\{#HELPTOOLS}\sci_gateway\helptools_gateway.xml; DestDir: {app}\modules\{#HELPTOOLS}\sci_gateway; Components: {#COMPN_SCILAB}
 Source: thirdparty\docbook\*.*;DestDir: {app}\thirdparty\docbook; Flags: recursesubdirs; Components: {#COMPN_SCILAB}
@@ -79,10 +82,6 @@ Source: modules\{#HELPTOOLS}\readme.txt; DestDir: {app}\modules\{#HELPTOOLS}; Co
 Source: modules\{#HELPTOOLS}\license.txt; DestDir: {app}\modules\{#HELPTOOLS}; Components: {#COMPN_SCILAB}
 Source: modules\{#HELPTOOLS}\changelog.txt; DestDir: {app}\modules\{#HELPTOOLS}; Components: {#COMPN_SCILAB}
 ;
-; disabled
-;Source: modules\{#HELPTOOLS}\jar\scilab_fr_FR_help.jar; DestDir: {app}\modules\{#HELPTOOLS}\jar; Components: {#COMPN_SCILAB}
-;Source: modules\{#HELPTOOLS}\jar\scilab_en_US_help.jar; DestDir: {app}\modules\{#HELPTOOLS}\jar; Components: {#COMPN_SCILAB}
-;
 ;Source: modules\{#HELPTOOLS}\*.xsl; DestDir: {app}\modules\{#HELPTOOLS}; Components: {#COMPN_SCILAB}
 ;Source: modules\{#HELPTOOLS}\help.dtd; DestDir: {app}\modules\{#HELPTOOLS}; Components: {#COMPN_SCILAB}
 ;
index 92a8df5..786fb22 100644 (file)
@@ -1,5 +1,6 @@
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 // Copyright (C) 2008 INRIA - Pierre MARECHAL <pierre.marechal@inria.fr>
+// Copyright (C) 2009 DIGITEO - Allan CORNET
 //
 // This file must be used under the terms of the CeCILL.
 // This source file is licensed as described in the file COPYING, which
@@ -9,6 +10,8 @@
 
 function generated_files = xmltochm(dirs,titles,directory_language,default_language)
        
+       all_scilab_help        = %F;
+       
        if ~MSDOS then
                warning(msprintf(gettext("%s: This function is only supported on Windows platforms.\n"),"xmltochm"));
                return;
@@ -21,18 +24,82 @@ function generated_files = xmltochm(dirs,titles,directory_language,default_langu
        
        case 0 then
                generated_files = xmltoformat("chm");
+               dirs = [];
+               
        case 1 then
                generated_files = xmltoformat("chm",dirs);
+
        case 2 then
                generated_files = xmltoformat("chm",dirs,titles);
+
        case 3 then
                generated_files = xmltoformat("chm",dirs,titles,directory_language);
+
        case 4 then
                generated_files = xmltoformat("chm",dirs,titles,directory_language,default_language);
+
        else
                error(msprintf(gettext("%s: Wrong number of input argument(s): At most %d expected.\n"),"xmltochm",4));
+       end
        
+       if (dirs == []) then 
+               all_scilab_help = %T;
        end
 
+       if MSDOS then
+               if (generated_files <> []) then
+                       if (getHHCpath() <> '') then
+                               for i = 1:size(generated_files,'*')
+                                       cmdline = getHHCpath() + ' ' +getshortpathname(generated_files(i));
+                                       [msg,err] = dos(cmdline);
+                                       chm_origin = 'htmlhelp.chm';
+
+                                       chm_name = tokens(generated_files(i),filesep());
+                                       chm_name = chm_name($-1);
+                                       chm_name = chm_name + '.chm';
+
+                                       chm_src = strsubst(generated_files(i),'htmlhelp.hhp',chm_origin);
+                                       dir_src_idx = strindex(chm_src,filesep());
+                                       dir_src_chm = part(chm_src,1:dir_src_idx($));
+                                               
+                                       if all_scilab_help then
+                                               if (i == 1) then
+                                                       dir_dest_chm = part(chm_src,1:dir_src_idx($-2)) + 'chm' + filesep();
+                                               else
+                                                       dir_dest_chm = part(chm_src,1:dir_src_idx($-3)) + 'chm' + filesep();
+                                               end
+                                       else
+                                               dir_dest_chm = part(chm_src,1:dir_src_idx($-3)) + 'chm' + filesep();
+                                       end
+                                       
+                                       chm_destination = dir_dest_chm  + chm_name;
+                                       
+                                       copyfile(chm_src, chm_destination);
+                                       generated_files(i) = chm_destination;
+                               end
+                       else
+                               warning(msprintf(gettext("%s: hhc.exe not found.\n"),"xmltochm"));
+                       end
+               else
+                       warning(msprintf(gettext("%s: no file generate.\n"),"xmltochm"));
+         end   
+       end
+       
+endfunction
+
+
+function HHC_path = getHHCpath()
+
+  if win64() then
+    std_path = getshortpathname(getenv('ProgramFiles(x86)','') + filesep() + 'HTML Help Workshop' + filesep() + 'hhc.exe');
+  else
+    std_path = getshortpathname(std_path = getenv('ProgramFiles','') + filesep() + 'HTML Help Workshop' + filesep() + 'hhc.exe');
+  end
+
+       if (fileinfo(std_path) == []) then
+         HHC_path = '';
+       else
+         HHC_path = std_path;
+       end
        
 endfunction
index 1a4ca44..06026e9 100644 (file)
@@ -235,7 +235,9 @@ function generated_files = xmltoformat(output_format,dirs,titles,directory_langu
                chdir(current_directory);
        end
        
+       
        if all_scilab_help then
+       
                for k=1:size(dirs_m,'*');
                        if ~isdir(dirs_m(k)) then
                                error(msprintf(gettext("%s: Directory %s does not exist or read access denied."),"xmltoformat",dirs_m(k)));
@@ -445,6 +447,10 @@ function generated_files = xmltoformat(output_format,dirs,titles,directory_langu
        
        // =========================================================================
        // Perform the help generation
+       // scilab help files generation
+       // 2 steps : 
+       // -- scilab help
+       // -- scilab internal toolbox (example: scicos)
        // =========================================================================
        
        if output_format=="javaHelp" then
@@ -454,6 +460,7 @@ function generated_files = xmltoformat(output_format,dirs,titles,directory_langu
        end
        
        is_html = (output_format == "html");
+       is_chm = (output_format == "chm");
        
        if all_scilab_help then
                
@@ -466,31 +473,39 @@ function generated_files = xmltoformat(output_format,dirs,titles,directory_langu
                        mkdir(final_output_dir);
                end
                
-               if is_html then
+               if is_chm then
+               
+               elseif is_html then
                        final_output_dir = pathconvert(final_output_dir+"/"+my_wanted_language,%f,%f);
                        if ~isdir(final_output_dir) then
                                mkdir(final_output_dir);
                        end
                end
                
-               // Define the final location of the generated file
-               if is_html then
-                       final_help_file = pathconvert(final_output_dir+"/index.html",%f,%f);
-               else
-                       final_help_file = pathconvert(final_output_dir+"/scilab_" + my_wanted_language + "_help." + output_format_ext,%f,%f);
-               end
-               
                // Define and create the path of buildDoc working directory
                buildDoc_dir  = pathconvert(SCI+"/modules/helptools/"+ output_format + "/scilab_" + my_wanted_language + "_help",%t,%f);
+               
                if ~isdir(pathconvert(SCI+"/modules/helptools/"+output_format,%f,%f)) then
                        mkdir(pathconvert(SCI+"/modules/helptools/"+output_format,%f,%f));
                end
+               
                if ~isdir(buildDoc_dir) then
                        mkdir(buildDoc_dir);
                end
                
+               // Define the final location of the generated file
+               if is_chm then
+                       final_help_file = pathconvert(buildDoc_dir + "htmlhelp.hhp",%f,%f);
+               elseif is_html then
+                       final_help_file = pathconvert(final_output_dir+"/index.html",%f,%f);
+               else
+                       final_help_file = pathconvert(final_output_dir+"/scilab_" + my_wanted_language + "_help." + output_format_ext,%f,%f);
+               end
+               
                // Define the path of the generated file created by buildDoc
-               if is_html then
+               if is_chm then
+                       buildDoc_file = pathconvert(buildDoc_dir + "htmlhelp.hhp",%f,%f);
+               elseif is_html then
                        buildDoc_file = pathconvert(buildDoc_dir + "index.html",%f,%f);
                else
                        buildDoc_file = pathconvert(buildDoc_dir + "scilab_" + my_wanted_language + "_help." + output_format_ext,%f,%f);
@@ -513,7 +528,9 @@ function generated_files = xmltoformat(output_format,dirs,titles,directory_langu
                end
                
                // move the generated file(s)
-               if is_html then
+               if is_chm then
+               
+               elseif is_html then
                        my_html_files = listfiles(buildDoc_dir);
                        for k=1:size(my_html_files,'*')
                                if ~copyfile(my_html_files(k),pathconvert(final_output_dir+"/"+my_html_files(k),%f,%f)) then
@@ -534,7 +551,10 @@ function generated_files = xmltoformat(output_format,dirs,titles,directory_langu
                // Now we can add the help file to the list of all generated files
                generated_files = [ generated_files ; final_help_file ];
                
+               // internal toolbox
+               // example: scicos
                // Now, build toolboxes help (if any)
+               
                for k=1:size(dirs_c,"*");
                        
                        this_tree  = contrib_tree(dirs_c(k));
@@ -560,28 +580,35 @@ function generated_files = xmltoformat(output_format,dirs,titles,directory_langu
                                error(msprintf(gettext("%s: Directory %s does not exist or read access denied."),"xmltoformat",cur_dir));
                        end
                        
-                       if is_html then
+                       if is_chm then
+                               final_output_dir = pathconvert(buildDoc_dir + "htmlhelp.hhp",%f,%f);
+                       elseif is_html then
                                final_output_dir = pathconvert(final_output_dir+"/"+directory_language_c(k),%f,%f);
                                if ~isdir(final_output_dir) then
                                        mkdir(final_output_dir);
                                end
                        end
                        
+                       // Define and create the path of buildDoc working directory
+                       buildDoc_dir  = pathconvert(dirs_c(k) + "/scilab_" + directory_language_c(k) + "_help",%t,%f);
+                       if ~isdir(buildDoc_dir) then
+                               mkdir(buildDoc_dir);
+                       end
+                       
                        // Define the final location of the generated file
-                       if is_html then
+                       if is_chm then
+                               final_help_file = pathconvert(buildDoc_dir + "htmlhelp.hhp",%f,%f);
+                       elseif is_html then
                                final_help_file = pathconvert(final_output_dir+"/index.html",%f,%f);
                        else
                                final_help_file = pathconvert(final_output_dir+"/scilab_" + directory_language_c(k) + "_help." + output_format_ext,%f,%f);
                        end
                        
-                       // Define and create the path of buildDoc working directory
-                       buildDoc_dir  = pathconvert(dirs_c(k) + "/scilab_" + directory_language_c(k) + "_help",%t,%f);
-                       if ~isdir(buildDoc_dir) then
-                               mkdir(buildDoc_dir);
-                       end
                        
                        // Define the path of the generated file created by buildDoc
-                       if is_html then
+                       if is_chm then
+                               buildDoc_file = pathconvert(buildDoc_dir + "htmlhelp.hhp",%f,%f);
+                       elseif is_html then
                                buildDoc_file = pathconvert(buildDoc_dir + "index.html",%f,%f);
                        else
                                buildDoc_file = pathconvert(buildDoc_dir + "scilab_" + directory_language_c(k) + "_help." + output_format_ext,%f,%f);
@@ -604,7 +631,9 @@ function generated_files = xmltoformat(output_format,dirs,titles,directory_langu
                        end
                        
                        // move the generated file(s)
-                       if is_html then
+                       if is_chm then
+                       
+                       elseif is_html then
                                my_html_files = listfiles(buildDoc_dir);
                                for k=1:size(my_html_files,'*')
                                        if ~copyfile(my_html_files(k),pathconvert(final_output_dir+"/"+my_html_files(k),%f,%f)) then
@@ -628,6 +657,10 @@ function generated_files = xmltoformat(output_format,dirs,titles,directory_langu
                end
                
        else
+       // ------------------------------
+       // external (Toolboxes)
+       // ------------------------------
+
                
                // Dirs are precised in the input arguments
                
@@ -666,28 +699,38 @@ function generated_files = xmltoformat(output_format,dirs,titles,directory_langu
                        
                        final_output_dir = pathconvert(pwd(),%f,%f);
                        
-                       if is_html then
-                               final_output_dir = pathconvert(final_output_dir+"/"+directory_language(k),%f,%f);
-                               if ~isdir(final_output_dir) then
-                                       mkdir(final_output_dir);
-                               end
-                       end
-                       
-                       // Define the final location of the generated file
-                       if is_html then
-                               final_help_file = pathconvert(final_output_dir+"/index.html",%f,%f);
+                       if is_chm then
+                               // nothing to do
                        else
-                               final_help_file = pathconvert(final_output_dir+"/scilab_" + directory_language(k) + "_help." + output_format_ext,%f,%f);
+                               if is_html then
+                                       final_output_dir = pathconvert(final_output_dir+"/"+directory_language(k),%f,%f);
+                                       if ~isdir(final_output_dir) then
+                                               mkdir(final_output_dir);
+                                       end
+                               end
                        end
-                       
+
                        // Define and create the path of buildDoc working directory
                        buildDoc_dir  = pathconvert(dirs(k) + "/scilab_" + directory_language(k) + "_help",%t,%f);
                        if ~isdir(buildDoc_dir) then
                                mkdir(buildDoc_dir);
                        end
                        
+                       // Define the final location of the generated file
+                       if is_chm then
+                               final_help_file = pathconvert(buildDoc_dir + "htmlhelp.hhp",%f,%f);
+                       else
+                               if is_html then
+                                       final_help_file = pathconvert(final_output_dir+"/index.html",%f,%f);
+                               else
+                                       final_help_file = pathconvert(final_output_dir+"/scilab_" + directory_language(k) + "_help." + output_format_ext,%f,%f);
+                               end
+                       end
+                       
                        // Define the path of the generated file created by buildDoc
-                       if is_html then
+                       if is_chm then
+                               buildDoc_file = pathconvert(buildDoc_dir + "htmlhelp.hhp",%f,%f);
+                       elseif is_html then
                                buildDoc_file = pathconvert(buildDoc_dir + "index.html",%f,%f);
                        else
                                buildDoc_file = pathconvert(buildDoc_dir + "scilab_" + directory_language(k) + "_help." + output_format_ext,%f,%f);
@@ -707,7 +750,9 @@ function generated_files = xmltoformat(output_format,dirs,titles,directory_langu
                        end
                        
                        // move the generated file(s)
-                       if is_html then
+                       if is_chm then
+                       // nothing to do
+                       elseif is_html then
                                my_html_files = listfiles(buildDoc_dir);
                                for k=1:size(my_html_files,'*')
                                        if ~copyfile(my_html_files(k),pathconvert(final_output_dir+"/"+my_html_files(k),%f,%f)) then
index a49ebf8..fc2b1d1 100644 (file)
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="Windows-1252"?>
 <VisualStudioProject
        ProjectType="Visual C++"
-       Version="9.00"
+       Version="9,00"
        Name="BuildChm"
        ProjectGUID="{D319F719-F429-4842-A6F9-B1227FE2A54D}"
        Keyword="MakeFileProj"
-       
+       TargetFrameworkVersion="0"
        >
        <Platforms>
                <Platform
@@ -26,9 +26,9 @@
                        >
                        <Tool
                                Name="VCNMakeTool"
-                               BuildCommandLine="nmake /f &quot;makefile.mak&quot; build /a"
-                               ReBuildCommandLine="nmake /f &quot;makefile.mak&quot; build /a"
-                               CleanCommandLine="nmake /f &quot;makefile.mak&quot; clean /a"
+                               BuildCommandLine="IF EXIST &quot;$(SolutionDir)modules\helptools\chm&quot; rmdir /s /q &quot;$(SolutionDir)modules\helptools\chm&quot;&#x0D;&#x0A;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l en -e xmltochm([],[],&apos;en_US&apos;);exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l fr -e xmltochm([],[],&apos;fr_FR&apos;);exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l pt_BR -e xmltochm([],[],&apos;pt_BR&apos;);exit;&#x0D;&#x0A;"
+                               ReBuildCommandLine="IF EXIST &quot;$(SolutionDir)modules\helptools\chm&quot; rmdir /s /q &quot;$(SolutionDir)modules\helptools\chm&quot;&#x0D;&#x0A;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l en -e xmltochm([],[],&apos;en_US&apos;);exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l fr -e xmltochm([],[],&apos;fr_FR&apos;);exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l pt_BR -e xmltochm([],[],&apos;pt_BR&apos;);exit;&#x0D;&#x0A;&#x0D;&#x0A;"
+                               CleanCommandLine="IF EXIST &quot;$(SolutionDir)modules\helptools\chm&quot; rmdir /s /q &quot;$(SolutionDir)modules\helptools\chm&quot;&#x0D;&#x0A;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\helptools\chm&quot; del /q &quot;$(SolutionDir)modules\helptools\chm\scilab_*.chm&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\chm&quot; del  /q &quot;$(SolutionDir)modules\scicos\chm\scilab_*.chm&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\en_US\scilab_en_US_help&quot;  rmdir /s /q &quot;$(SolutionDir)modules\scicos\help\en_US\scilab_en_US_help&quot;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\en_US\master_help.xml&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\en_US\master_help.xml&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\en_US\.last_successful_build_javaHelp&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\en_US\.last_successful_build_javaHelp&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\fr_FR\scilab_fr_FR_help&quot;  rmdir /s /q &quot;$(SolutionDir)modules\scicos\help\fr_FR\scilab_fr_FR_help&quot;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\fr_FR\master_help.xml&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\fr_FR\master_help.xml&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\fr_FR\.last_successful_build_javaHelp&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\fr_FR\.last_successful_build_javaHelp&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\pt_BR\scilab_pt_BR_help&quot;  rmdir /s /q &quot;$(SolutionDir)modules\scicos\help\pt_BR\scilab_pt_BR_help&quot;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\pt_BR\master_help.xml&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\pt_BR\master_help.xml&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\pt_BR\.last_successful_build_javaHelp&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\pt_BR\.last_successful_build_javaHelp&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -l en -nouserstartup -nw -e clean_help();exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -l fr -nouserstartup -nw -e clean_help();exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -l pt_BR -nouserstartup -nw -e clean_help();exit;&#x0D;&#x0A;"
                                Output=""
                                PreprocessorDefinitions=""
                                IncludeSearchPath=""
@@ -46,9 +46,9 @@
                        >
                        <Tool
                                Name="VCNMakeTool"
-                               BuildCommandLine="nmake /f &quot;makefile.mak&quot; build /a"
-                               ReBuildCommandLine="nmake /f &quot;makefile.mak&quot; build /a"
-                               CleanCommandLine="nmake /f &quot;makefile.mak&quot; clean /a"
+                               BuildCommandLine="IF EXIST &quot;$(SolutionDir)modules\helptools\chm&quot; rmdir /s /q &quot;$(SolutionDir)modules\helptools\chm&quot;&#x0D;&#x0A;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l en -e xmltochm([],[],&apos;en_US&apos;);exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l fr -e xmltochm([],[],&apos;fr_FR&apos;);exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l pt_BR -e xmltochm([],[],&apos;pt_BR&apos;);exit;&#x0D;&#x0A;"
+                               ReBuildCommandLine="IF EXIST &quot;$(SolutionDir)modules\helptools\chm&quot; rmdir /s /q &quot;$(SolutionDir)modules\helptools\chm&quot;&#x0D;&#x0A;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l en -e xmltochm([],[],&apos;en_US&apos;);exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l fr -e xmltochm([],[],&apos;fr_FR&apos;);exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l pt_BR -e xmltochm([],[],&apos;pt_BR&apos;);exit;&#x0D;&#x0A;&#x0D;&#x0A;"
+                               CleanCommandLine="IF EXIST &quot;$(SolutionDir)modules\helptools\chm&quot; rmdir /s /q &quot;$(SolutionDir)modules\helptools\chm&quot;&#x0D;&#x0A;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\helptools\chm&quot; del /q &quot;$(SolutionDir)modules\helptools\chm\scilab_*.chm&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\chm&quot; del  /q &quot;$(SolutionDir)modules\scicos\chm\scilab_*.chm&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\en_US\scilab_en_US_help&quot;  rmdir /s /q &quot;$(SolutionDir)modules\scicos\help\en_US\scilab_en_US_help&quot;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\en_US\master_help.xml&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\en_US\master_help.xml&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\en_US\.last_successful_build_javaHelp&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\en_US\.last_successful_build_javaHelp&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\fr_FR\scilab_fr_FR_help&quot;  rmdir /s /q &quot;$(SolutionDir)modules\scicos\help\fr_FR\scilab_fr_FR_help&quot;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\fr_FR\master_help.xml&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\fr_FR\master_help.xml&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\fr_FR\.last_successful_build_javaHelp&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\fr_FR\.last_successful_build_javaHelp&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\pt_BR\scilab_pt_BR_help&quot;  rmdir /s /q &quot;$(SolutionDir)modules\scicos\help\pt_BR\scilab_pt_BR_help&quot;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\pt_BR\master_help.xml&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\pt_BR\master_help.xml&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\pt_BR\.last_successful_build_javaHelp&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\pt_BR\.last_successful_build_javaHelp&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -l en -nouserstartup -nw -e clean_help();exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -l fr -nouserstartup -nw -e clean_help();exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -l pt_BR -nouserstartup -nw -e clean_help();exit;&#x0D;&#x0A;"
                                Output=""
                                PreprocessorDefinitions=""
                                IncludeSearchPath=""
@@ -66,9 +66,9 @@
                        >
                        <Tool
                                Name="VCNMakeTool"
-                               BuildCommandLine="nmake /f &quot;makefile.mak&quot; build /a"
-                               ReBuildCommandLine="nmake /f &quot;makefile.mak&quot; build /a"
-                               CleanCommandLine="nmake /f &quot;makefile.mak&quot; clean /a"
+                               BuildCommandLine="IF EXIST &quot;$(SolutionDir)modules\helptools\chm&quot; rmdir /s /q &quot;$(SolutionDir)modules\helptools\chm&quot;&#x0D;&#x0A;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l en -e xmltochm([],[],&apos;en_US&apos;);exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l fr -e xmltochm([],[],&apos;fr_FR&apos;);exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l pt_BR -e xmltochm([],[],&apos;pt_BR&apos;);exit;&#x0D;&#x0A;"
+                               ReBuildCommandLine="IF EXIST &quot;$(SolutionDir)modules\helptools\chm&quot; rmdir /s /q &quot;$(SolutionDir)modules\helptools\chm&quot;&#x0D;&#x0A;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l en -e xmltochm([],[],&apos;en_US&apos;);exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l fr -e xmltochm([],[],&apos;fr_FR&apos;);exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l pt_BR -e xmltochm([],[],&apos;pt_BR&apos;);exit;&#x0D;&#x0A;&#x0D;&#x0A;"
+                               CleanCommandLine="IF EXIST &quot;$(SolutionDir)modules\helptools\chm&quot; rmdir /s /q &quot;$(SolutionDir)modules\helptools\chm&quot;&#x0D;&#x0A;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\helptools\chm&quot; del /q &quot;$(SolutionDir)modules\helptools\chm\scilab_*.chm&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\chm&quot; del  /q &quot;$(SolutionDir)modules\scicos\chm\scilab_*.chm&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\en_US\scilab_en_US_help&quot;  rmdir /s /q &quot;$(SolutionDir)modules\scicos\help\en_US\scilab_en_US_help&quot;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\en_US\master_help.xml&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\en_US\master_help.xml&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\en_US\.last_successful_build_javaHelp&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\en_US\.last_successful_build_javaHelp&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\fr_FR\scilab_fr_FR_help&quot;  rmdir /s /q &quot;$(SolutionDir)modules\scicos\help\fr_FR\scilab_fr_FR_help&quot;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\fr_FR\master_help.xml&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\fr_FR\master_help.xml&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\fr_FR\.last_successful_build_javaHelp&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\fr_FR\.last_successful_build_javaHelp&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\pt_BR\scilab_pt_BR_help&quot;  rmdir /s /q &quot;$(SolutionDir)modules\scicos\help\pt_BR\scilab_pt_BR_help&quot;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\pt_BR\master_help.xml&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\pt_BR\master_help.xml&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\pt_BR\.last_successful_build_javaHelp&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\pt_BR\.last_successful_build_javaHelp&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -l en -nouserstartup -nw -e clean_help();exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -l fr -nouserstartup -nw -e clean_help();exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -l pt_BR -nouserstartup -nw -e clean_help();exit;&#x0D;&#x0A;"
                                Output=""
                                PreprocessorDefinitions=""
                                IncludeSearchPath=""
@@ -86,9 +86,9 @@
                        >
                        <Tool
                                Name="VCNMakeTool"
-                               BuildCommandLine="nmake /f &quot;makefile.mak&quot; build /a"
-                               ReBuildCommandLine="nmake /f &quot;makefile.mak&quot; build /a"
-                               CleanCommandLine="nmake /f &quot;makefile.mak&quot; clean /a"
+                               BuildCommandLine="IF EXIST &quot;$(SolutionDir)modules\helptools\chm&quot; rmdir /s /q &quot;$(SolutionDir)modules\helptools\chm&quot;&#x0D;&#x0A;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l en -e xmltochm([],[],&apos;en_US&apos;);exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l fr -e xmltochm([],[],&apos;fr_FR&apos;);exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l pt_BR -e xmltochm([],[],&apos;pt_BR&apos;);exit;&#x0D;&#x0A;"
+                               ReBuildCommandLine="IF EXIST &quot;$(SolutionDir)modules\helptools\chm&quot; rmdir /s /q &quot;$(SolutionDir)modules\helptools\chm&quot;&#x0D;&#x0A;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l en -e xmltochm([],[],&apos;en_US&apos;);exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l fr -e xmltochm([],[],&apos;fr_FR&apos;);exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -nouserstartup -nw -l pt_BR -e xmltochm([],[],&apos;pt_BR&apos;);exit;&#x0D;&#x0A;&#x0D;&#x0A;"
+                               CleanCommandLine="IF EXIST &quot;$(SolutionDir)modules\helptools\chm&quot; rmdir /s /q &quot;$(SolutionDir)modules\helptools\chm&quot;&#x0D;&#x0A;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\helptools\chm&quot; del /q &quot;$(SolutionDir)modules\helptools\chm\scilab_*.chm&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\chm&quot; del  /q &quot;$(SolutionDir)modules\scicos\chm\scilab_*.chm&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\en_US\scilab_en_US_help&quot;  rmdir /s /q &quot;$(SolutionDir)modules\scicos\help\en_US\scilab_en_US_help&quot;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\en_US\master_help.xml&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\en_US\master_help.xml&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\en_US\.last_successful_build_javaHelp&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\en_US\.last_successful_build_javaHelp&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\fr_FR\scilab_fr_FR_help&quot;  rmdir /s /q &quot;$(SolutionDir)modules\scicos\help\fr_FR\scilab_fr_FR_help&quot;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\fr_FR\master_help.xml&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\fr_FR\master_help.xml&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\fr_FR\.last_successful_build_javaHelp&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\fr_FR\.last_successful_build_javaHelp&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\pt_BR\scilab_pt_BR_help&quot;  rmdir /s /q &quot;$(SolutionDir)modules\scicos\help\pt_BR\scilab_pt_BR_help&quot;&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\pt_BR\master_help.xml&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\pt_BR\master_help.xml&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;IF EXIST &quot;$(SolutionDir)modules\scicos\help\pt_BR\.last_successful_build_javaHelp&quot;  del /q &quot;$(SolutionDir)modules\scicos\help\pt_BR\.last_successful_build_javaHelp&quot;  1&gt;NUL 2&gt;NUL&#x0D;&#x0A;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -l en -nouserstartup -nw -e clean_help();exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -l fr -nouserstartup -nw -e clean_help();exit;&#x0D;&#x0A;&quot;$(SolutionDir)bin\scilex.exe&quot; -nb -l pt_BR -nouserstartup -nw -e clean_help();exit;&#x0D;&#x0A;"
                                Output=""
                                PreprocessorDefinitions=""
                                IncludeSearchPath=""
index 7e05837..1207233 100644 (file)
@@ -157,8 +157,28 @@ public class BuildDocObject extends StyleSheet {
                        } catch (java.io.IOException e) {
                                System.err.println(ERROR_WHILE_COPYING + cssFile + TO + outputDirectory + COLON + e.getMessage());                      
                        }
-                       
                }
+               
+        /* CHM Format */
+               if (format.equalsIgnoreCase("CHM")) {
+                       specificArgs.add("use.id.as.filename=1");
+                       specificArgs.add("html.stylesheet=htmlhelp.css");
+                       specificArgs.add(USE_EXTENSIONS_1);
+                       specificArgs.add(GRAPHICSIZE_EXTENSION_0);
+                       specificArgs.add("\"generate.toc= \"");
+                       this.styleDoc = docbookPath + "/htmlhelp/htmlhelp.xsl";
+
+                       /* Copy the css file for thr HTML pages */
+                       String cssFile=new String(SCI+"/modules/helptools/css/htmlhelp.css");
+                       try {
+                               Helpers.copyFile(new File(cssFile), new File(outputDirectory+"/htmlhelp.css"));
+                       } catch (java.io.FileNotFoundException e) {
+                               System.err.println(ERROR_WHILE_COPYING + cssFile + TO + outputDirectory + COLON + e.getMessage());                      
+                       } catch (java.io.IOException e) {
+                               System.err.println(ERROR_WHILE_COPYING + cssFile + TO + outputDirectory + COLON + e.getMessage());                      
+                       }
+               }
+               
 
                /* Java Help */
                if (format.equalsIgnoreCase(JH_FORMAT) || format.equalsIgnoreCase(JAVAHELP_FORMAT)) {
diff --git a/scilab/modules/helptools/tests/unit_tests/xmltochm.tst b/scilab/modules/helptools/tests/unit_tests/xmltochm.tst
new file mode 100644 (file)
index 0000000..e455041
--- /dev/null
@@ -0,0 +1,115 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO - Allan CORNET
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- ENGLISH IMPOSED -->
+// <-- NO CHECK ERROR OUTPUT -->
+// <-- NEED JVM -->
+
+// xmltochm
+
+if MSDOS then 
+
+// TEST 1 (french help and english help are complete)
+// =============================================================================
+
+my_module_path = pathconvert(SCI+"/modules/helptools/examples/example_1",%f,%f);
+
+// Build the french help
+
+setlanguage("fr_FR");
+my_french_help_dir    =  my_module_path+"/help/fr_FR";
+my_french_help_title  =  "TEST 1 [fr_FR]";
+xmltochm(my_french_help_dir,my_french_help_title,"fr_FR");
+
+chm_info =  fileinfo(my_module_path+"/chm/scilab_fr_FR_help.chm");
+if chm_info == [] then pause, end       // file existence
+if chm_info(1) < 5000 then pause, end   // file size
+
+clean_help(my_french_help_dir);
+
+// Build the english help
+
+setlanguage("en_US");
+my_english_help_dir    =  my_module_path+"/help/en_US";
+my_english_help_title  =  "TEST 1 [en_US]";
+xmltochm(my_english_help_dir,my_english_help_title,'en_US');
+
+chm_info =  fileinfo(my_module_path+"/chm/scilab_en_US_help.chm");
+if chm_info == [] then pause, end       // file existence
+if chm_info(1) < 5000 then pause, end   // file size
+
+clean_help(my_english_help_dir);
+
+
+
+// TEST 2 (example_2_function_2 and example_2_function_4 are missing in the
+//         french help)
+// =============================================================================
+
+my_module_path = pathconvert(SCI+"/modules/helptools/examples/example_2",%f,%f);
+
+// Build the french help
+
+setlanguage("fr_FR");
+my_french_help_dir    =  my_module_path+"/help/fr_FR";
+my_french_help_title  =  "TEST 2 [fr_FR]";
+xmltochm(my_french_help_dir,my_french_help_title,'fr_FR');
+
+chm_info =  fileinfo(my_module_path+"/chm/scilab_fr_FR_help.chm");
+if chm_info == [] then pause, end       // file existence
+if chm_info(1) < 5000 then pause, end   // file size
+
+clean_help(my_french_help_dir);
+
+// Build the english help
+
+setlanguage("en_US");
+my_english_help_dir    =  my_module_path+"/help/en_US";
+my_english_help_title  =  "TEST 2 [en_US]";
+xmltochm(my_english_help_dir,my_english_help_title,'en_US');
+
+chm_info =  fileinfo(my_module_path+"/chm/scilab_en_US_help.chm");
+if chm_info == [] then pause, end       // file existence
+if chm_info(1) < 5000 then pause, end   // file size
+
+clean_help(my_english_help_dir);
+
+
+
+// TEST 3 (example_3_function_3 and example_3_function_4 are missing in the
+//         english help)
+// =============================================================================
+
+my_module_path = pathconvert(SCI+"/modules/helptools/examples/example_3",%f,%f);
+
+// Build the french help
+
+setlanguage("fr_FR");
+my_french_help_dir    =  my_module_path+"/help/fr_FR";
+my_french_help_title  =  "TEST 3 [fr_FR]";
+xmltochm(my_french_help_dir,my_french_help_title,"fr_FR");
+
+chm_info =  fileinfo(my_module_path+"/chm/scilab_fr_FR_help.chm");
+if chm_info == [] then pause, end       // file existence
+if chm_info(1) < 5000 then pause, end   // file size
+
+clean_help(my_french_help_dir);
+
+// Build the english help
+
+setlanguage("en_US");
+my_english_help_dir    =  my_module_path+"/help/en_US";
+my_english_help_title  =  "TEST 3 [en_US]";
+xmltochm(my_english_help_dir,my_english_help_title,"en_US","fr_FR");
+
+chm_info =  fileinfo(my_module_path+"/chm/scilab_en_US_help.chm");
+if chm_info == [] then pause, end       // file existence
+if chm_info(1) < 5000 then pause, end   // file size
+
+clean_help(my_english_help_dir);
+
+end // if MSDOS
\ No newline at end of file
diff --git a/scilab/modules/helptools/tests/unit_tests/xmltochm.win.dia.ref b/scilab/modules/helptools/tests/unit_tests/xmltochm.win.dia.ref
new file mode 100644 (file)
index 0000000..dff5de5
--- /dev/null
@@ -0,0 +1,161 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO - Allan CORNET
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- ENGLISH IMPOSED -->
+// <-- NO CHECK ERROR OUTPUT -->
+// <-- NEED JVM -->
+// xmltochm
+if MSDOS then 
+// TEST 1 (french help and english help are complete)
+// =============================================================================
+my_module_path = pathconvert(SCI+"/modules/helptools/examples/example_1",%f,%f);
+// Build the french help
+setlanguage("fr_FR");
+my_french_help_dir    =  my_module_path+"/help/fr_FR";
+my_french_help_title  =  "TEST 1 [fr_FR]";
+xmltochm(my_french_help_dir,my_french_help_title,"fr_FR");
+
+
+Buildingthemasterdocument:
+
+       SCI\modules\helptools\examples\example_1\help\fr_FR
+
+
+
+Constructiondufichiermanuel[chm]dansSCI\modules\helptools\examples\example_1\help\fr_FR.(Veuillezpatienter...celapeutprendreuncertaintemps)
+
+chm_info =  fileinfo(my_module_path+"/chm/scilab_fr_FR_help.chm");
+if chm_info == [] then bugmes();quit;end       // file existence
+if chm_info(1) < 5000 then bugmes();quit;end   // file size
+clean_help(my_french_help_dir);
+--Suppressiondesfichiersd'aide--
+
+...
+
+// Build the english help
+setlanguage("en_US");
+my_english_help_dir    =  my_module_path+"/help/en_US";
+my_english_help_title  =  "TEST 1 [en_US]";
+xmltochm(my_english_help_dir,my_english_help_title,'en_US');
+
+
+Buildingthemasterdocument:
+
+       SCI\modules\helptools\examples\example_1\help\en_US
+
+
+
+Buildingthemanualfile[chm]inSCI\modules\helptools\examples\example_1\help\en_US.(Pleasewaitbuilding...thiscantakeawhile)
+
+chm_info =  fileinfo(my_module_path+"/chm/scilab_en_US_help.chm");
+if chm_info == [] then bugmes();quit;end       // file existence
+if chm_info(1) < 5000 then bugmes();quit;end   // file size
+clean_help(my_english_help_dir);
+--Deletinghelpfiles--
+
+...
+
+// TEST 2 (example_2_function_2 and example_2_function_4 are missing in the
+//         french help)
+// =============================================================================
+my_module_path = pathconvert(SCI+"/modules/helptools/examples/example_2",%f,%f);
+// Build the french help
+setlanguage("fr_FR");
+my_french_help_dir    =  my_module_path+"/help/fr_FR";
+my_french_help_title  =  "TEST 2 [fr_FR]";
+xmltochm(my_french_help_dir,my_french_help_title,'fr_FR');
+
+
+Buildingthemasterdocument:
+
+       SCI\modules\helptools\examples\example_2\help\fr_FR
+
+
+
+Constructiondufichiermanuel[chm]dansSCI\modules\helptools\examples\example_2\help\fr_FR.(Veuillezpatienter...celapeutprendreuncertaintemps)
+
+chm_info =  fileinfo(my_module_path+"/chm/scilab_fr_FR_help.chm");
+if chm_info == [] then bugmes();quit;end       // file existence
+if chm_info(1) < 5000 then bugmes();quit;end   // file size
+clean_help(my_french_help_dir);
+--Suppressiondesfichiersd'aide--
+
+...
+
+// Build the english help
+setlanguage("en_US");
+my_english_help_dir    =  my_module_path+"/help/en_US";
+my_english_help_title  =  "TEST 2 [en_US]";
+xmltochm(my_english_help_dir,my_english_help_title,'en_US');
+
+
+Buildingthemasterdocument:
+
+       SCI\modules\helptools\examples\example_2\help\en_US
+
+
+
+Buildingthemanualfile[chm]inSCI\modules\helptools\examples\example_2\help\en_US.(Pleasewaitbuilding...thiscantakeawhile)
+
+chm_info =  fileinfo(my_module_path+"/chm/scilab_en_US_help.chm");
+if chm_info == [] then bugmes();quit;end       // file existence
+if chm_info(1) < 5000 then bugmes();quit;end   // file size
+clean_help(my_english_help_dir);
+--Deletinghelpfiles--
+
+...
+
+// TEST 3 (example_3_function_3 and example_3_function_4 are missing in the
+//         english help)
+// =============================================================================
+my_module_path = pathconvert(SCI+"/modules/helptools/examples/example_3",%f,%f);
+// Build the french help
+setlanguage("fr_FR");
+my_french_help_dir    =  my_module_path+"/help/fr_FR";
+my_french_help_title  =  "TEST 3 [fr_FR]";
+xmltochm(my_french_help_dir,my_french_help_title,"fr_FR");
+
+
+Buildingthemasterdocument:
+
+       SCI\modules\helptools\examples\example_3\help\fr_FR
+
+
+
+Constructiondufichiermanuel[chm]dansSCI\modules\helptools\examples\example_3\help\fr_FR.(Veuillezpatienter...celapeutprendreuncertaintemps)
+
+chm_info =  fileinfo(my_module_path+"/chm/scilab_fr_FR_help.chm");
+if chm_info == [] then bugmes();quit;end       // file existence
+if chm_info(1) < 5000 then bugmes();quit;end   // file size
+clean_help(my_french_help_dir);
+--Suppressiondesfichiersd'aide--
+
+...
+
+// Build the english help
+setlanguage("en_US");
+my_english_help_dir    =  my_module_path+"/help/en_US";
+my_english_help_title  =  "TEST 3 [en_US]";
+xmltochm(my_english_help_dir,my_english_help_title,"en_US","fr_FR");
+
+
+Buildingthemasterdocument:
+
+       SCI\modules\helptools\examples\example_3\help\en_US
+
+
+
+Buildingthemanualfile[chm]inSCI\modules\helptools\examples\example_3\help\en_US.(Pleasewaitbuilding...thiscantakeawhile)
+
+chm_info =  fileinfo(my_module_path+"/chm/scilab_en_US_help.chm");
+if chm_info == [] then bugmes();quit;end       // file existence
+if chm_info(1) < 5000 then bugmes();quit;end   // file size
+clean_help(my_english_help_dir);
+--Deletinghelpfiles--
+
+...
+
+end // if MSDOS
index 8c4efc9..eeba0fe 100644 (file)
@@ -22,6 +22,7 @@ src/scicos_sundials/scicos_sundials.def
 #
 #generated help files
 #
+chm
 help/en_US/master_help.xml
 help/fr_FR/master_help.xml
 help/en_US/scilab_en_US_help/
index ff51e01..293f84e 100644 (file)
@@ -42,8 +42,13 @@ Source: modules\{#SCICOS}\etc\{#SCICOS}.start; DestDir: {app}\modules\{#SCICOS}\
 ;
 ;
 Source: modules\{#SCICOS}\help\addchapter.sce; DestDir: {app}\modules\{#SCICOS}\help; Flags: recursesubdirs; Components:  {#COMPN_SCICOS}
+;
 Source: modules\{#SCICOS}\jar\*.jar; DestDir: {app}\modules\{#SCICOS}\jar; Flags: recursesubdirs; Components:  {#COMPN_SCICOS}
 ;
+#ifdef WITH_CHM
+Source: modules\{#SCICOS}\chm\*.chm; DestDir: {app}\modules\{#SCICOS}\chm; Components: {#COMPN_SCILAB}
+#endif
+;
 Source: modules\{#SCICOS}\includes\*.h; DestDir: {app}\modules\{#SCICOS}\includes; Components: {#COMPN_SCICOS}
 ;
 Source: modules\{#SCICOS}\macros\buildmacros.sce; DestDir: {app}\modules\{#SCICOS}\macros; Flags: recursesubdirs; Components: {#COMPN_SCICOS}