DEV Community

HarmonyOS
HarmonyOS

Posted on

How to generate ArkTSDoc documentation in DevEco Studio?

Read the original article:How to generate ArkTSDoc documentation in DevEco Studio?

Question

How to generate ArkTSDoc documentation in DevEco Studio?

Short Answer

  • Use the "Generate ArkTSDoc" feature in DevEco Studio to create documentation.
  • Supported file types include: .ets, .ts, .js, and .md.
  • Only exported variables, methods, APIs, and classes are included in the generated documentation.
  • The output documentation retains the original directory structure of your project.
  • To generate documentation:
    • Go to Tools > Generate ArkTSDoc... from the menu bar.
    • Set the scope and output directory.
    • (Optional) Enable "Open generated documentation in browser" for automatic preview.

cke_2480.png

  • After generation:
    • If browser preview is enabled, it opens automatically.
    • If not, a notification appears—click "Go to Folder" and open the file manually.

Applicable Scenarios

ArkTSDoc documentation is useful for developers who want to generate clear and structured documentation for their HarmonyOS projects. It helps teams understand exported variables, methods, APIs, and classes without manually reading code. This feature is particularly beneficial in large projects, collaborative environments, or when preparing documentation for external users or stakeholders. Automatic browser preview also allows for quick verification and sharing of generated docs.

Reference Link

https://developer.huawei.com/consumer/en/doc/harmonyos-guides/ide-arktsdoc-generation

Written by Emine Inan

Top comments (0)