<< slr_check_arg slr slr_convert_arglist >>

slr >> slr > slr_comments_to_xml

slr_comments_to_xml

Generates the xml files of help from the head comments of a .sci file or a directory.

Syntax

help_xml = slr_comments_to_xml(src)
help_xml = slr_comments_to_xml(src, help_dir)

Parameters

src (string)

source file or directory to be processed.

target (string)

directory in which the help file(s) will be placed

Description

This routines generates .xml help files based on the head comments of .sci files. Note that the head comments can either be made with single line comments or with block comments.

In order for this routine to format the .xml file properly, the head comments should comply with some simple formatting rules.

In particular, the head comments should be divided in different sections which content is then specifically formatted. The predefined sections are: 'Syntax', 'Parameters', 'Description', 'Examples', 'See also', 'Used functions', 'Authors' and 'Bibliography'. To be recognised, these headlines should be alone on a line.

The content of each section must also comply with some rules to be formatted adequately:

Markdown-like support

A basic markdown support is implemented for the sections description, examples, and any user defined section.

It supports:

Examples

Here is an example of the results this function can produce

target    = './';                            // where the xml file will be created
xml_str   = slr_comments_to_xml([], target); // with an empty source, it will apply to itself
my_title  = 'slr_comments_to_xml_demo';
xmltojar(target, my_title)                   // generate a jar file from the xml
ok = add_help_chapter(my_title,target);      // adding the help chapter
help();

See also

Authors


Report an issue
<< slr_check_arg slr slr_convert_arglist >>