modify order in help without modify modules.xml (remove modules disabled) SCI/modules... 91/2591/4
Allan CORNET [Wed, 24 Nov 2010 12:30:41 +0000 (13:30 +0100)]
Change-Id: I031ca68c241c295b8e95e4000086bbaa5ea9f766

scilab/modules/helptools/Makefile.am
scilab/modules/helptools/Makefile.in
scilab/modules/helptools/etc/MAIN_CHAPTERS [new file with mode: 0644]
scilab/modules/helptools/helptools.iss
scilab/modules/helptools/macros/xmltoformat.sci

index 486b1b9..998b901 100644 (file)
@@ -61,15 +61,13 @@ INCLUDE_FLAGS = $(libscihelptools_la_CFLAGS)
 #### Target ######
 modulename=helptools
 
-
 #### helptools : Conf files ####
 libscihelptools_la_rootdir = $(mydatadir)
 libscihelptools_la_root_DATA = changelog.txt license.txt readme.txt version.xml
 
-
 #### helptools : init scripts ####
 libscihelptools_la_etcdir = $(mydatadir)/etc
-libscihelptools_la_etc_DATA = etc/helptools.quit etc/helptools.start
+libscihelptools_la_etc_DATA = etc/helptools.quit etc/helptools.start etc/MAIN_CHAPTERS
 
 #### helptools : bin files ####
 libscihelptools_la_bindir = $(mydatadir)/bin
@@ -81,7 +79,6 @@ bin/manrev2sci
 libscihelptools_la_sci_gatewaydir = $(mydatadir)/sci_gateway
 libscihelptools_la_sci_gateway_DATA = sci_gateway/helptools_gateway.xml
 
-
 #### New documentation generation system
 libscihelptools_la_data_configurationdir = $(mydatadir)/data/configuration
 libscihelptools_la_data_configuration_DATA = data/configuration/scilab_primitives.txt \
@@ -89,7 +86,6 @@ data/configuration/scilab_macros.txt
 
 libscihelptools_la_data_templatedir = $(mydatadir)/data/template
 libscihelptools_la_data_template_DATA = data/template/template_javahelp.html
-
 libscihelptools_la_data_cssdir = $(mydatadir)/data/css
 libscihelptools_la_data_css_DATA = data/css/scilab_code.css \
 data/css/style.css
index be829d4..fd9603e 100644 (file)
@@ -478,7 +478,7 @@ libscihelptools_la_root_DATA = changelog.txt license.txt readme.txt version.xml
 
 #### helptools : init scripts ####
 libscihelptools_la_etcdir = $(mydatadir)/etc
-libscihelptools_la_etc_DATA = etc/helptools.quit etc/helptools.start
+libscihelptools_la_etc_DATA = etc/helptools.quit etc/helptools.start etc/MAIN_CHAPTERS
 
 #### helptools : bin files ####
 libscihelptools_la_bindir = $(mydatadir)/bin
diff --git a/scilab/modules/helptools/etc/MAIN_CHAPTERS b/scilab/modules/helptools/etc/MAIN_CHAPTERS
new file mode 100644 (file)
index 0000000..4e0cd6a
--- /dev/null
@@ -0,0 +1,74 @@
+core
+differential_equations
+elementary_functions
+linear_algebra
+interpolation
+cacsd
+polynomials
+signal_processing
+fftw
+special_functions
+randlib
+arnoldi
+statistics
+sparse
+umfpack
+optimization
+genetic_algorithms
+simulated_annealing
+symbolic
+fileio
+io
+graphics
+renderer
+graphic_export
+gui
+data_structures
+parameters
+boolean
+double
+integer
+string
+sound
+time
+output_stream
+xcos
+scicos
+scicos_blocks
+spreadsheet
+shell
+console
+completion
+history_manager
+matio
+m2sci
+mexlib
+compatibility_functions
+maple2scilab
+overloading
+functions
+development_tools
+demo_tools
+dynamic_link
+windows_tools
+atoms
+tclsci
+hdf5
+scinotes
+texmacs
+ui_data
+history_browser
+helptools
+parallel
+pvm
+modules_manager
+localization
+action_binding
+jvm
+api_scilab
+call_scilab
+javasci
+intersci
+graph
+commons
+types
index 3381456..b8bf0b1 100644 (file)
@@ -78,6 +78,7 @@ Source: modules\{#HELPTOOLS}\data\*.*; DestDir: {app}\modules\{#HELPTOOLS}\data;
 ;
 Source: modules\{#HELPTOOLS}\etc\{#HELPTOOLS}.quit; DestDir: {app}\modules\{#HELPTOOLS}\etc; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE}
 Source: modules\{#HELPTOOLS}\etc\{#HELPTOOLS}.start; DestDir: {app}\modules\{#HELPTOOLS}\etc; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE}
+Source: modules\{#HELPTOOLS}\etc\MAIN_CHAPTERS; DestDir: {app}\modules\{#HELPTOOLS}\etc; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE}
 ;
 Source: modules\{#HELPTOOLS}\macros\buildmacros.sce; DestDir: {app}\modules\{#HELPTOOLS}\macros; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE}
 Source: modules\{#HELPTOOLS}\macros\buildmacros.bat; DestDir: {app}\modules\{#HELPTOOLS}\macros; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE}
index 6f8fb30..3c90566 100644 (file)
@@ -28,15 +28,15 @@ function generated_files = xmltoformat(output_format,dirs,titles,directory_langu
     // if dirs is not specified or [] then standard scilab man are assumed and
     // titles are searched in %helps
     // =========================================================================
+    
+    my_wanted_language  = getlanguage(); // This variable is only need when
+                                         // build all scilab help
 
     global %helps;
     global %helps_modules;
 
     if %helps_modules == [] then
-      moduleslist = getmodules();
-      for i = 1:size(moduleslist,'*')
-        add_module_help_chapter(moduleslist(i));
-      end
+       x2f_reset_help_mod_var(my_wanted_language);
     end
 
     %HELPS = [%helps_modules; %helps];
@@ -55,8 +55,6 @@ function generated_files = xmltoformat(output_format,dirs,titles,directory_langu
     generated_files = [];
 
     all_scilab_help     = %F;
-    my_wanted_language  = getlanguage(); // This variable is only need when
-                                         // build all scilab help
 
     [lhs,rhs] = argn(0);
 
@@ -83,7 +81,7 @@ function generated_files = xmltoformat(output_format,dirs,titles,directory_langu
         if rhs == 4 then
             my_wanted_language = directory_language;
             x2f_reset_help_mod_var(my_wanted_language);
-            %HELPS=[%helps_modules;%helps];
+            %HELPS = [%helps_modules; %helps];
         end
 
         dirs_to_build          = %HELPS;
@@ -487,7 +485,7 @@ function generated_files = xmltoformat(output_format,dirs,titles,directory_langu
         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); 
+            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
@@ -515,7 +513,7 @@ function generated_files = xmltoformat(output_format,dirs,titles,directory_langu
         else
           buildDoc(output_format,modules_tree("master_document"), my_wanted_language);
         end
-        
+
         // Check if the help file has been generated
         if fileinfo(buildDoc_file)==[] then
             error(msprintf(gettext("%s: %s has not been generated."),"xmltoformat",buildDoc_file));
@@ -613,7 +611,7 @@ function generated_files = xmltoformat(output_format,dirs,titles,directory_langu
             else
               buildDoc(output_format,this_tree("master_document"),directory_language_c(k),dirs_c(k));
             end
-            
+
             // Check if the help file has been generated
             if fileinfo(buildDoc_file)==[] then
                 error(msprintf(gettext("%s: %s has not been generated."),"xmltoformat",buildDoc_file));
@@ -836,16 +834,41 @@ function x2f_reset_help_mod_var(language)
 
     // Reset the variable in hand
     %helps_modules = [];
-
-    // Get module list
-    module_list = getmodules();
-
-    // Loop on modules
-    for k=1:size(module_list,'*');
-        addchapter_path = getlongpathname(SCI+"/modules/"+module_list(k)+"/help/"+language+"/addchapter.sce");
-        if fileinfo(addchapter_path)<>[] then
-            exec(addchapter_path,-1);
+    
+    modules_ordered_list = mgetl(SCI + "/modules/helptools/etc/MAIN_CHAPTERS");
+    // remove empty lines in MAIN_CHAPTERS
+    modules_ordered_list(modules_ordered_list == "") = [];
+      
+    // get current modules used by scilab
+    current_modules_list = getmodules();
+      
+    size_current_modules = size(current_modules_list, "*");
+    size_modules_ordered = size(modules_ordered_list, "*");
+    
+    if size_current_modules > size_modules_ordered then
+      error(msprintf(gettext("%s: Please check %s, number of modules is invalid.\n"), "xmltoformat", SCI + "/modules/helptools/etc/MAIN_CHAPTERS"));
+    end
+    
+    // Remove modules not present
+    k = 1;
+    cleaned_ordered_modules = [];
+    for i = 1:size_modules_ordered
+      for j = 1:size_current_modules
+        if (current_modules_list(j) == modules_ordered_list(i)) then
+          cleaned_ordered_modules(k) = modules_ordered_list(i);
+          k = k + 1;
         end
+      end
+    end
+    
+    size_cleaned_modules = size(cleaned_ordered_modules, "*");
+    
+    // Loop on modules available ordered
+    for k = 1:size_cleaned_modules;
+      addchapter_path = SCI + "/modules/" + cleaned_ordered_modules(k) + "/help/" + language + "/addchapter.sce";
+      if isfile(addchapter_path) then
+        exec(addchapter_path, -1);
+      end
     end
 
 endfunction