Documentation

我们为许可用户提供了部分翻译好的中文文档。您只需登录便可查阅这些文档

builddocsearchdb

Build searchable documentation database

Syntax

Description

example

builddocsearchdb(folder) builds a searchable database, also referred to as a search index, from HTML files in the specified folder.

The builddocsearchdb function creates a subfolder, helpsearch-v3, to contain the database files. The database enables MATLAB® to search for content within the HTML files assuming the MATLAB version is the same version used to create the database.

Beginning with MATLAB R2014b, you can maintain search indexes side by side. For instance, if you already have a search index for MATLAB R2014a or earlier, run builddocsearchdb against your help files using MATLAB R2014b or later. Then, when you run any MATLAB release, the help browser automatically uses the appropriate index for searching your documentation database.

Examples

collapse all

Search Custom Help Files

Build a search database for custom help files.

MATLAB includes a set of sample files to demonstrate how to create a custom toolbox and supporting documentation. This sample toolbox is called the Upslope Area Toolbox. The upslope folder includes a file named info.xml, which is required to display custom documentation, and a subfolder named html, which contains HTML documentation and supporting files.

Copy the sample files to a temporary folder, and add the copied files to the path.

sample = fullfile(...
         matlabroot,'help','techdoc','matlab_env',...
         'examples','upslope');
tmp = tempname;
mkdir(tmp);
copyfile(sample,tmp);
addpath(tmp);

Create a search database.

folder = fullfile(tmp,'html');
builddocsearchdb(folder)

Under the Supplemental Software heading, click Upslope Area Toolbox.

Search the supplemental documentation for the term tarboton, which appears in several of the example help files. The search returns several results from the Upslope Area Toolbox.

Remove the temporary example files.

rmpath(tmp)
rmdir(tmp,'s')

    Note:   Your help appears alongside the MathWorks documentation only when you are viewing installed documentation. If you are viewing documentation on the web, your documentation displays in a help browser separate from the MathWorks documentation.

Input Arguments

collapse all

folder — Full path to folder with HTML filesstring

Full path to a folder with HTML files, specified as a string. The folder must be:

  • On the MATLAB search path

  • Outside the matlabroot folder

  • Outside any installed Hardware Support Package help folder

To include a particular HTML document in the search database, the builddocsearchdb function requires that:

  • The document has a title.

  • The content is different from the title.

Example: builddocsearchdb('c:\myfiles\html')

See Also

|

Was this topic helpful?