Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

Providing Your Files in the Help Browser

Overview of Providing Files for the Help Browser

A toolbox is a collection of files for use with MathWorks products that a user creates and provides to other users. For toolboxes you create, you can provide HTML help files and demos.

If you want your users to access the help files and demos in the Help browser, add them to the Help browser using special XML files.

You can also provide access to your help files and demos from the Start button

Providing HTML Help Files

Creating and Viewing HTML Help Files

Creating HTML help files for your toolbox allows you to include more than the text information that you can include with M-file help. For example, in HTML help files, you can use figures, illustrations, screen captures, equations, and formatting to make your help more usable.

To create HTML help files, use the MATLAB Editor, another text editor, or an HTML editing tool. If you use the Editor, use syntax highlighting and indenting features for HTML and related files. To customize the syntax highlighting and indenting in the Editor, select File > Preferences > Editor/Debugger > Language, and choose HTML.

To view an HTML help file that you created, use the web function. in MATLAB. For example, display my_help_file.html in the MATLAB Web browser:

web('I:\my_matlab_files\my_help_file.html')

To display the file in the Help browser, use the web function with the -helpbrowser option:

web('fullpath/filename.html', '-helpbrowser')

Include a link from M-file help for a function to an HTML help file. MATLAB M-file help includes a link to the HTML reference page for the function. To create this link in the M-file help, use a matlabcolon statement (matlab:) with the web statement.

Process for Adding Help Files to the Help Browser

Add HTML help files for your own toolbox to the Help browser so users can access them using the Help browser Contents pane. Optionally, provide a search database for your help files so users can find information in your help files using the Help browser search features.

The Help browser determines what to display using info.xml files on the search path. For the Help browser to display your HTML files in the Help browser:

If you also want to include your toolbox on the Start button, put the Help browser and Start button information into a single info.xml file.

Instructions for Adding Help Files to the Help Browser

Follow these instructions to add your own HTML help files to the Help browser. Use the example files provided for the SpecSim (Example) Toolbox.

First, follow the procedure using the example files to see how it works. Then customize all the names and content for your files, or repeat the procedure for your files and delete the example files and folders.

  1. Create or choose a folder for storing your help files. You must have write access to the folder. For this example, the folder name is specsim_example.

  2. Add the folder to the search path. For the example, add specsim_example to the search path.

  3. Create your info.xml file:

    1. Copy matlabroot/help/techdoc/matlab_env/examples/helpinfo_specsim.xml to the folder. For the example, copy the file to specsim_example.

    2. Rename helpinfo_specsim.xml to info.xml. In the example, rename helpinfo_specsim.xml in the specsim_example folder to info.xml.

  4. Follow these steps to prepare the Help Contents pane and your HTML files:

    1. In the folder containing your info.xml file, create a subfolder for your help files. For the example, in specsim_example, create specsim_example_helpfiles.

    2. From matlabroot/help/techdoc/matlab_env/examples, copy helptoc_specsim.xml and helpfuncbycat_specsim.xml to the folder for your help files. For the example, copy the files to specsim_example_helpfiles.

    3. In the folder containing your files, rename helptoc_specsim.xml to helptoc.xml, and helpfuncbycat_specsim.xml to helpfuncbycat.xml. In the example, rename the files in specsim_example_helpfiles.

    4. Put your HTML help files in the same folder as your helptoc.xml. For the example, copy specsimicon.gif and the set of specsim_... HTML files from matlabroot/help/techdoc/matlab_env/examples to specsim_example_helpfiles.

  5. In the Editor, open, modify, and save your info.xml, helptoc.xml, and helpfuncbycat.xml files:

    1. In helptoc.xml, change the value in <tocreference target=> from "helpfunctbycat_specsim.xml" to "helpfunctbycat.xml".

    2. Make other changes to helptoc.xml, info.xml, and helpfuncbycat.xml files for your toolbox. For details, see File Descriptions for Adding Your Help Files. For the example, make no other changes.

  6. Select your toolbox in the Help browser product filter so that the Help browser displays it. Use Preferences > Help to access the product filter.

  7. View your HTML help files in the Help browser Contents pane.

    Image of Help browser showing SpecSim (Example) Toolbox selected in the Contents pane and displaying an HTML page of the SpecSim (Example) documentation in the display pane.

File Descriptions for Adding Your Help Files

Description of the info.xml File.   The info.xml file adds the HTML help files to the Help browser. The table describes the example info.xml file provided for the SpecSim (Example) Toolbox, matlabroot/help/techdoc/matlab_env/examples/helpinfo_specsim.xml.

XML Tag

Description

Value in Example

Notes

<matlabrelease>

Release of MATLAB.

R2009b

Not currently used.

<name>

Title of toolbox.

SpecSim (Example)

The name of your toolbox that appears in the Help browser Contents pane.

<type>

Determines the toolbox location in the Help browser Contents.

toolbox

Allowable values: matlab, toolbox, simulink, blockset, links_targets, other. SpecSim (Example) Toolbox appears with other toolboxes. The entry has the icon for toolboxes, an orange book.

<icon>

Icon for your toolbox help in the Start button.

None

If you put your toolbox on the Start button and include a help entry there, specify an image to use for it. In this example, the Start button is not used.

<help_location>

Location of help files

specsim_example_helpfiles

Location of helptoc.xml and HTML help files you provide for your toolbox. Specify the path to help_location relative to the location of the info.xml file. If you provide HTML help files for multiple toolboxes, each help_location must be unique.

<list>

<listitem> ...

Entries for Start button

None

If you also want your toolbox to appear in the Start button, add at least one listitem. For details, see Adding Your Own Toolboxes to the Start Button.

Help Files to Include in <help_location> in the info.xml File.   Put these help files into the folder you specified for help_location in the info.xml file.

File Name

Required or Optional

Description 

helptoc.xml

Required

The file that the Help browser displays in the Contents pane. It shows your toolbox at the top level and defines the hierarchical entries within it. It references your HTML help files. A helptoc.xml file provided for the example, helptoc_specsim.xml, illustrates the structure. If you include icons, provide them in a folder within matlabroot/help and specify their path using $help/..., as shown in the example. You can also specify a full path.

HTML help files

Required

Help files you created for your toolbox. helptoc.xml references at least one of these files.

helpfuncbycat.xml

helpblockbycat.xml

Optional

Referenced by helptoc.xml, provide a Functions category and Blocks category in the Help browser Content for your toolbox. A file provided for the example, helpfuncbycat_specsim.xml, illustrates the structure. Include this entry only if you provide the necessary files. See Including Function and Block Entries in the Contents Pane.

helpsearch folder containing files for search database

Optional

Allows the Help browser search to find your pages. Include this entry only if you provide the necessary files. See Making Your Help Files Searchable.

Including Function and Block Entries in the Contents Pane.   To include a Functions and Blocks listing for your toolbox in the Help browser Contents pane:

  1. Create an HTML help file for each function or block in your toolbox. Store them in the same location as the helptoc.xml file for the toolbox. For the example, copy the files matlabroot/help/techdoc/matlab_env/examples/specsim_f1.html through specsim_f3.html to specsim_example_helpfiles.

  2. Create a function summary or block summary HTML file. In the file, provide helpful information, such as category names and functions in the category. You can include links to the function or block documentation like the MATLAB functions by category page does. For the example, copy the file matlabroot/help/techdoc/matlab_env/specsim_function_list.html to specsim_example_helpfiles.

  3. Include a helpfuncbycat.xml, helpblockbycat.xml, or both in the same location as your helptoc.xml file. For the example, copy matlabroot/help/techdoc/matlab_env/examples/helpfuncbycat_specsim.xml to specsim_example_helpfiles.

  4. In helptoc.xml for the toolbox, include a tocreference entry for functions, blocks, or both:

    <tocreference target="helpfuncbycat.xml"></tocreference>
    <tocreference target="helpblockbycat.xml"></tocreference>

    See this entry in the example file, helptoc_specsim.xml.

More Examples of info.xml Files.   For additional examples, see the info.xml files for MathWorks products:

  1. Select Start > Desktop Tools > View Start Button Configuration Files files.

  2. From the resulting Start Button Configuration Files dialog box, select a product.

  3. Click Open to view the info.xml file.

Making Your Help Files Searchable

The builddocsearchdb function creates a searchable database that the Help browser search requires to find your help files. Build the database after creating the info.xml file for your toolbox, and after storing your HTML help files in the help_location specified in the info.xml file. This example uses the info.xml file for the SpecSim (Example) toolbox with the help_location specified as I:\my_matlab_files\specsim_example_helpfiles.

  1. Add the folder containing your info.xml file to the search path.

    For the example, add I:\my_matlab_files\specsim_example\specsim_example_helpfiles to the path.

  2. Create a searchable database by running builddocsearchdb('full_path to_help_location'). For the example, run:

    builddocsearchdb ('I:\my_matlab_files\specsim_example\specsim_example_helpfiles')

    Running builddocsearchdb creates a folder named helpsearch in the help_location folder. For the example, it creates I:\my_matlab_files\specsim_example_helpfiles\helpsearch.

    The function also creates three files in helpsearch. It creates the deletable and segments file names each time you run builddocsearchdb. The name of the third file it creates varies, but always has the cfs extension.

  3. Test the search features for your files.

    1. Set the product filter to only your toolbox. To access the product filter, select File > Preferences > Help.

    2. Use the search field in the Help browser to search for any words in the HTML help files that you provided in the help_location folder. This example shows a search of SpecSim (Example) HTML help files for the term specsim gui.

Providing Demos

Creating Demos

You can provide demos and related files of any file type for your toolbox.

One way to produce demos is with the cell-publishing feature, available in the Editor. It creates a demo file to run in MATLAB and an HTML file that describes how the demo works. For more information, see Overview of Publishing M-Files.

Process for Adding Demos to the Help Browser

Add demos for your own toolbox to the Help browser so users can access them using the Help browser Contents pane. The Help browser determines the demos to display using demos.xml files on the search path. For the Help browser to display your demos in the Help browser:

Instructions for Adding Demos to the Help Browser

Follow these instructions to add your own demos files to the Help browser. Example files are provided for the SpecSim (Example) Toolbox.

  1. Create or choose a folder for storing your demos files. You must have write access to the folder. For this example, the folder name is I:/my_matlab_files/specsim_demo

  2. Add the folder for your demos files to the search path. The folder cannot be the current folder when you add it to the path.

  3. Get an example demos.xml file to use as the basis for your own file. Copy matlabroot/help/techdoc/matlab_env/examples/demos_specsim.xml to the folder for your demos files. For the example, copy it to I:/my_matlab_files/specsim_demo.

  4. Rename the copy of the file to demos.xml. For the example, rename the demos_specsim.xml file in I:/my_matlab_files/specsim_demo to demos.xml.

  5. View the example demos.xml file in the Help browser. A new node, Other Demos, appears at the end of the Help browser Contents pane. Expand it to view the entry just added, SpecSim (Example) Toolbox.

  6. In the Editor, open the demos.xml file. For the example, open I:/my_matlab_files/specsim_demo/demos.xml.

  7. Change the demos.xml file to include the information for your toolbox, and save the changes.

    For details, see File Description for demos.xml.

  8. Refresh the Help browser to see your demos in Other Demos. Remove the folder containing the demos.xml file from the search path, and then add it to the search path. For the example, remove I:/my_matlab_files/specsim_demo from the search path, and then add I:/my_matlab_files/specsim_demo to the search path.

File Description for demos.xml.   Within the demos.xml file, the root tag is <demos> and it includes one <name>, <type>, <icon> and <description> for your toolbox demos.

Include a <demoitem> for each demo you provide. Or, to provide categories of demos, include a <demosection> for each category, which contains <demoitem> entries. If you use any categories, then all demos must be in categories. In other words, if there is even one <demosection>, then all demoitem tags must be within demosection tags.

Line

XML Tag

Notes 

Value for Example

2

<demos>

The root element for a demos.xml file.

No value

4

<name>

Name of your toolbox. It appears under Other Demos in the Help browser.

SpecSim (Example) Toolbox

5

<type>

The product type. Allowable values are matlab, simulink, toolbox, blockset, links_targets, or other.

Not currently used.

toolbox

6

<icon>

Use an icon for your demo. You can specify a relative path, that is, relative to the location of the info.xml file. This example uses $toolbox/... to reference an icon in a matlabroot/toolbox folder.

$toolbox/matlab/icons/
matlabicon.gif

7

<description>

The description that appears in the Help browser display pane, on the main page for your demo.

SpecSim (Example) Toolbox is ...

11 to 12

<website>
<a href=
"url"</a>
</website>

Links to a Web site. For example, MathWorks demos include a link near the top, on the right: Product page at mathworks.com. The <website> tag can appear anywhere before the </demos> tag. For the example, displays The MathWorks Web site.

href = "http://www.mathworks.com/"
For more information...

14

<demosection>

Begins a category of demos. Each category includes a <label>, description, and at least one <demoitem>. Use for each demo category.

No value required

15

<label>

Title shown in Help browser for a <demosection>.

SpecSim Demos for Functions (Example)

16

<demoitem>

Contains <label> and at least one of these tags: <callback> or <file>. Use one <demoitem> per demo.

No value required

17

<label>

Title shown for demoitem.

SpecSim function1 demo (example)...

18

<callback>

The name of a file. When you double-click the demo icon or click the title text for the demo item in the Help browser, the file runs.

demoone (File not provided. The value is only an example name.)

22

<file>

An HTML file. Specify a relative path from the location of demos.xml. When you click the demo name in the Help browser Contents pane, the HTML file displays in the Help browser .

demotwo.html (File not provided. The value is only an example name.)

None

<dependency>

Optional. Specifies other products required to run the demo, such as another toolbox. The text must match a product name specified in an info.xml file that is on the search path or in the current folder.

Not shown

Validating info.xml Files You Provide

When MATLAB finds an info.xml file on the search path or in the current folder, it tries to add information to the Help browser or Start button. MATLAB automatically validates the file against the supported schema. If there is an invalid construct in the info.xml file, MATLAB displays an error in the Command Window. The error is typically of the form:

XML-file failed validation against schema located in
...
XML-file name: full path to...\info.xml 

An info.xml validation error can occur when you start MATLAB, press the Start button, or under certain other circumstances.

See these causes of the XML file validation error and what to do:

Outdated info.xml File for MATLAB Product

If you have an info.xml file from a different version of MATLAB, it could contain constructs that are not valid with your version. To identify an info.xml file from another version, look at the full path names reported in the error message. The path usually includes a version number, for example, ...\MATLAB\R14\... . The error is not actually causing any problems and you can safely ignore it. To ensure that the error does not occur, remove the offending info.xml file, or ensure that it is not on the search path or in the current folder.

info.xml File Unrelated to MATLAB Product

If the info.xml is an unrelated file, and not intended to add information to the Start button or Help browser, the validation error is irrelevant. In this case, the error is not actually causing any problems and you can safely ignore it. To ensure that the error does not occur, rename the offending info.xml file, or ensure that it is not on the search path or in the current folder.

info.xml File Intended for Use with MATLAB Software Contains Invalid Constructs

If the purpose of the info.xml file is to add information to the Start button or Help browser, correct the reported problem. Use the message in the error to isolate the problem or use any validator. One validator you can use is from the W3C® at http://www.w3.org/2001/03/webdata/xsv. For more information about the structure of the info.xml file, consult its schema, located at matlabroot/sys/namespace/info/v1/info.xsd.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS