Since version 26.0.0, Command Line Tools integrates the arktsdoc tool, which generates reference documentation (ArkTSDoc) from variables, methods, interfaces, classes, and other elements that need to be exposed in code files via the arktsdoc command line.
The arktsdoc command format is as follows:
arktsdoc [options] [dir]
options: (optional) command-line configuration parameters. For details, see Table 1.
dir: (optional) directory, which can be an absolute path or a relative path.
Parameter | Description |
|---|---|
--help/-h | Flag to display the help information for the arktsdoc command. |
--version/-v | Flag to display the version information of the arktsdoc command. |
--workspace/-w | (Optional) Root directory of a project. Both absolute and relative paths are supported. Only one project can be specified at a time. The default value is the directory where the current command is executed. |
--input/-i | (Optional) Path of a project, module, file, or directory, which is used to set the scope for ArkTSDoc generation. Both absolute and relative paths (relative to the project path) are supported. Multiple paths can be specified, separated by semicolons (;). The entire path string must be enclosed in quotation marks. |
--exclude/-e | (Optional) Path of the file or directory that does not need to be exported during ArkTSDoc generation. Both absolute and relative paths are supported. Multiple paths can be specified, separated by semicolons (;). The entire path string must be enclosed in quotation marks. Ant-style path matching patterns are supported, where ? matches a single character, * matches a single-level directory or file, and ** matches zero or more directory levels. |
--destination/-d | (Optional) Output directory for the generated ArkTSDoc. Both relative and absolute paths are supported. By default, an output directory is created under the current command execution directory to store the generated ArkTSDoc. |
The arktsdoc tool is located in the bin directory of Command Line Tools. Before running the command, configure the bin directory to the PATH variable.
arktsdoc -h
Usage: arktsdoc [options] [dir]
Options:
-h, --help Display help for command
-e, --exclude [excludePaths] Indicates the excludePaths of project. Optional.
-i, --input <input> Indicates the input file/directory.
-w, --workspace <path> Indicates the project path of current path.
-d, --destination <path> Indicates the path of the generation result.
-v, --version Display the version number and quit. arktsdoc -v
arktsdoc
arktsdoc -w D:\MyApplication
arktsdoc -w D:\MyApplication -i entry
arktsdoc -w D:\MyApplication -i entry -e entry/test
arktsdoc -w D:\MyApplication -i entry -e entry/test -d D:\doc