recipe-doc

1.1.0 • Public • Published

recipe-doc

apidoc 注释抽取命令行工具, 导出的数据可以直接发送给 recipe 生成项目。

快速开始

# 全局安装 recipe-doc 命令行工具 
$ npm i recipe-doc -g
# 显示帮助 
$ recipe-doc --help
 
  Usage: recipe-doc [options] <path>
 
  a cli tool and export comment for recipe
 
 
  Options:
 
    -V, --version                 output the version number
    -p, --project <project_path>  project path
    -e, --export [export_path]    comments data export path
    -n, --name <file_name>        export file name (default: recipe.json)
    -c, --conf <config_file>      config file name (default: .reciperc)
    -h, --help                    output usage information

首先应在项目的根目录下新建一个 .reciperc 的配置文件,配置文件内容如下

{
  "isPublis": false,                  // 项目 api 文档是否公开
  "creator": {
    "type": "individual",             // 可选值为 individual(个人项目) 或 collective(团队项目)
    "name": "yaokui.xiong@ele.me"     // 若为个人项目,请提供个人对应的饿了么邮箱,否则提供团队名称
  },
  "dirs":"src"                        // 抽取注释的目录,可以为数组
}
 

注释遵循 apidoc 规范,上面工作准备完后:

$ recipe-doc -p ${project_path}

执行完成后,就可以在 recipe 看到你生成的项目啦。

/recipe-doc/

    Package Sidebar

    Install

    npm i recipe-doc

    Weekly Downloads

    3

    Version

    1.1.0

    License

    MIT

    Last publish

    Collaborators

    • geemo
    • lellansin
    • wangdashuai