npm 包 grunt-atomdoc 使用教程

阅读时长 3 分钟读完

什么是 grunt-atomdoc?

grunt-atomdoc 是一个基于 Grunt 的插件,可用于生成文档。

特别适用于为使用 Atom 这一编辑器的项目生成文档,可以轻松地生成符合 Atom Doc 规范的文档。

如何使用 grunt-atomdoc

  1. 全局安装 Grunt

在开始使用 grunt-atomdoc 之前,你需要安装 Grunt。可以使用以下命令进行全局安装:

  1. 安装 grunt-atomdoc

使用以下命令进行 grunt-atomdoc 的安装:

  1. 配置 grunt-atomdoc

在你的 Gruntfile.js 中配置 grunt-atomdoc:

-- -------------------- ---- -------
-------------- - --------------- -
  ------------------
    -------- -
      ----- -
        ---- ----------------
        ----- ----------
      -
    -
  ---

  ------------------------------------

  ----------------------------- -------------
--
展开代码

以上示例使用了 Grunt 的简单配置方式(详细配置请参考 grunt-atomdoc 文档)。

  1. 运行 grunt-atomdoc

使用以下命令运行 grunt-atomdoc:

示例代码

以下是一个使用 grunt-atomdoc 的示例代码:

-- -------------------- ---- -------
---
 - ------------
 - ---------- ---
 --
-------- ------- --

---
 - -------
 - ------------ ----
 - ------ -------- - - -- -
 - ------ -------- - - -- -
 - -------- -------- -----
 --
------------------- - ----------- -- -
  ------ - - --
--
展开代码

当执行 grunt atomdoc 后,将会在 docs/api 目录下生成 HTML 格式的文档。

结语

grunt-atomdoc 可以帮助你快速生成符合 Atom Doc 规范的文档,是一个非常实用的工具。

希望本文对你有所帮助。

来源:JavaScript中文网 ,转载请注明来源 https://www.javascriptcn.com/post/73860

纠错
反馈

纠错反馈