目录

ArkTSDoc Generator (arktsdoc)

Overview

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.

  • If the path entered in the command line contains special characters such as "$", "|", "<", ">", "%", "^", ",", ":", "=", or "*", the command may fail to be parsed, resulting in reference document export failures. You are advised to enclose the path string in quotation marks or delete the special characters from the path.
  • For parameter parsing issues caused by OS differences, adjust the command parameters to comply with specifications and ensure successful parsing.
Table 1 arktsdoc command-line parameters

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.

Environment Setup

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.

Example