<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2008 - INRIA
 *
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
 *
 -->
<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" xmlns:scilab="http://www.scilab.org" xml:id="xmltohtml" xml:lang="en">
    <refnamediv>
        <refname>xmltohtml</refname>
        <refpurpose>converts xml Scilab help files to HTML format</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>xmltohtml(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 a 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 HTML 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

tmpPath = TMPDIR + "/examples";
copyfile("SCI/modules/helptools/examples", tmpPath);
my_module_path = pathconvert(tmpPath + "/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]';
my_french_html_dir    = xmltohtml(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]';
my_english_html_dir   = xmltohtml(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]';
my_chinese_html_dir   = xmltohtml(my_chinese_help_dir,my_chinese_help_title,'zh_TW')
 ]]>
        </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>
