// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab // Copyright (C) 2008 - INRIA // 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.1-en.txt function txt = help_skeleton(funname, path, language) [lhs,rhs] = argn(0); if rhs > 3 | rhs < 1 then error(39); end if type(funname) <> 10 then error(999,msprintf(gettext("%s: Wrong type for input argument #%d: A string expected.\n"),"help_skeleton",1)); end if size(funname, "*") <> 1 then error(999,msprintf(gettext("%s: Wrong size for input argument #%d: A string expected.\n"),"help_skeleton",1)); end if rhs > 1 then if type(path) <> 10 then error(55,2); end end previouslangage = getlanguage(); if rhs == 3 then if type(language) <> 10 then error(55,3); end setlanguage(language); else language = getlanguage(); end txt = []; vars = macrovar(evstr(funname)); inputs = vars(1); outputs = vars(2); context = vars(3); Call = ""; if size(outputs,"*") == 1 then Call = outputs + " = " elseif size(outputs,"*") > 1 then Call = "["+strcat(outputs,",")+"] = "; end Call = Call + funname; if size(inputs,"*") >= 1 then Call = Call+"("+strcat(inputs,",")+")"; end args = [inputs(:);outputs(:)]; // date management // -------------------------------------------------------------------------------- w = getdate(); xml_date = msprintf("%02d-%02d-%04d",w(6),w(2),w(1)); //header // -------------------------------------------------------------------------------- xmlns = "xmlns=""http://docbook.org/ns/docbook""" xlink = "xmlns:xlink=""http://www.w3.org/1999/xlink""" svg = "xmlns:svg=""http://www.w3.org/2000/svg""" mml = " xmlns:mml=""http://www.w3.org/1998/Math/MathML""" db = "xmlns:db=""http://docbook.org/ns/docbook""" scins = "xmlns:scilab=""http://www.scilab.org""" refs = strcat([xmlns xlink svg mml db scins]," ") txt=["" "" "" " " " "+ funname + "" " " + _("Add short description here.") + "" " " " " " " + _("Calling Sequence") + "" " " + Call + "" " "]; //Arguments if size(args,"*") >0 then txt=[txt; " " " " + _("Arguments") + "" " "] for a=args' txt=[txt; " " " " + a + "" " " " " _(" Add here the input/output argument description.") " " " " " "] end txt=[txt; " " " "]; end //Description txt=[txt; " " " " + _("Description") + "" " " _(" Add here a paragraph of the function description.") _(" Other paragraph can be added") " " " With a latex expression" " " " \begin{eqnarray}" " f(x,a,r) = \frac{1}{r^{-a}\Gamma(a)} \int_0^x t^{a-1} \exp\left(-rt\right) dt" " \end{eqnarray}" " " " " " "]; // More information txt=[txt; " " " " + _("More information") + "" " A note about foo" " A caution about foo" " A warning about foo" " An important about foo" " A tip about foo" " "]; //Example txt=[txt; " " " " + _("Examples") + "" " " " " " "]; //See Also txt=[txt; " " " " + _("See Also") + "" " " " " " " + _("add a reference") + "" " " " " " " + _("add a reference") + "" " " " " " "]; //Authors txt=[txt; " " " " + _("Authors") + "" " " " " + _("add the author name and author reference") + "" " " + _("add another author name and his/her reference") + "" " " " "]; //Bibliography txt = [txt; " " " " + _("Bibliography") + "" " " _(" Add here the function bibliography") " " " "]; // History txt = [txt; " " " " + _("History") + "" " " " " " X.Y" " Function foo added" " " " " " "]; //Used functions txt=[txt; " " " " + _("Used Functions") + "" " " _(" Add here the Scilab, C,... used code references") " " " "]; //footer txt=[txt; ""]; setlanguage(previouslangage); if rhs >= 2 then mputl(txt, pathconvert(path,%t,%f) + funname + ".xml"); txt = pathconvert(path,%t,%f) + funname + ".xml"; end endfunction