~ubuntu-branches/ubuntu/trusty/scilab/trusty

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2008 - INRIA
 * 
 * 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="xmltojar" xml:lang="en">
  <refnamediv>
    <refname>xmltojar</refname>
    <refpurpose>converts xml Scilab help files to javaHelp format</refpurpose>
  </refnamediv>
  <refsynopsisdiv>
    <title>Calling Sequence</title>
    <synopsis>xmltojar(dirs [,titles [,dir_language [default_language]]]]])</synopsis>
  </refsynopsisdiv>
  <refsection>
    <title>Arguments</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 jar files.
    </para>
  </refsection>
  <refsection>
    <title>Examples</title>
    <programlisting role="example"><![CDATA[ 
// 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]';
xmltojar(my_french_help_dir,my_french_help_title,'fr_FR');

// Build the english help
// =============================================================================
my_english_help_dir   =  my_module_path+'/help/en_US';
my_english_help_title =  'Example 1 [en_US]';
xmltojar(my_english_help_dir,my_english_help_title,'en_US');

// Build the chinese help
// =============================================================================
my_chinese_help_dir   =  my_module_path+'/help/zh_TW';
my_chinese_help_title =  'Example 1 [zh_TW]';
xmltojar(my_chinese_help_dir,my_chinese_help_title,'zh_TW');

// Add french, english or chinese help chapters
// =============================================================================

if getlanguage() == 'fr_FR' then
  add_help_chapter(my_french_help_title,my_module_path+"/jar");

elseif getlanguage() == 'zh_TW' then
  add_help_chapter(my_chinese_help_title,my_module_path+"/jar");

else
  add_help_chapter(my_english_help_title,my_module_path+"/jar");
end

// See the result in the help browser
// =============================================================================
help();

// Del french and english help chapters
// =============================================================================
if getlanguage() == 'fr_FR' then
  del_help_chapter(my_french_help_title);
else
  del_help_chapter(my_english_help_title);
end
 ]]></programlisting>
  </refsection>
  <refsection role="see also">
    <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>