Objective-C 自动生成文档工具:appledoc 使用

将注释生成文档,在开发中会带来很大的便捷,好处自然你懂得,生成工具很多,appledoc 确实是最好用的,废话不多说,直接上手操作吧!

一、安装过程

  • 第一步:下载安装
    git clone git://github.com/tomaz/appledoc.git
    cd ./appledoc
    sudo sh install-appledoc.sh
    稍等一会,安装OK。
  • 第二步:安装验证:
    appledoc --help
    • 二、使用方法

    • 第一步:使用终端进入代码目录:
      1. 直接拖拽我们的工程到终端,然后回车一下
      2. 或者使用 cd+"项目名字目录" 同1
      3. 以上两种方法都可以进入到我们的工程根目录
    • 第二部:
      project-name: 项目名字
      project-company: 公司名称
      使用命令:
    • 1 appledoc --project-name "ettAiXuePaiNextGen" --project-company "etiantian" ./doc
    • 2 appledoc --output doc  --project-name "ettAiXuePaiNextGen"  --project-company "etiantian"  --company-id "com.etiantian.ettAiXuePaiNextGen" .
    • 注意后面 空格加.
    • 3 在 --output 命令前 可加 --no-create-docset 命令 不生成docset类型,生成html
    • WARN | Ignoring typedef block RespondHandler, already defined.

      WARN | Ignoring typedef block RespondHandler, already defined.

      WARN | Ignoring typedef block RespondHandler, already defined.

      WARN | Ignoring typedef block RespondHandler, already defined.

      WARN | Ignoring typedef enum TeacherCoursewareType, already defined.

      WARN | Ignoring typedef block RespondHandler, already defined.

      WARN | ETTOpenClassroomDoBackModel: Merged class's ETTOpenClassroomDoBackModel superclass is different from current!

      WARN | ETTOpenClassroomDoBackModel: Merged class's ETTOpenClassroomDoBackModel superclass is different from current!

      WARN | ETTOpenClassroomDoBackModel: Merged class's ETTOpenClassroomDoBackModel superclass is different from current!

      WARN | ETTOpenClassroomDoBackModel: Merged class's ETTOpenClassroomDoBackModel superclass is different from current!

      WARN | ETTOpenClassroomDoBackModel: Merged class's ETTOpenClassroomDoBackModel superclass is different from current!

      WARN | ETTOpenClassroomDoBackModel: Merged class's ETTOpenClassroomDoBackModel superclass is different from current!

      WARN | ETTOpenClassroomDoBackModel: Merged class's ETTOpenClassroomDoBackModel superclass is different from current!

      WARN | ETTOpenClassroomDoBackModel: Merged class's ETTOpenClassroomDoBackModel superclass is different from current!

      WARN | ETTOpenClassroomDoBackModel: Merged class's ETTOpenClassroomDoBackModel superclass is different from current!

      WARN | ETTOpenClassroomDoBackModel: Merged class's ETTOpenClassroomDoBackModel superclass is different from current!

      WARN | ETTOpenClassroomDoBackModel: Merged class's ETTOpenClassroomDoBackModel superclass is different from current!

      WARN | ETTOpenClassroomDoBackModel: Merged class's ETTOpenClassroomDoBackModel superclass is different from current!

      WARN | Ignoring typedef block CallBackHandler, already defined.

      WARN | unsupported typedef enum at AFURLRequestSerialization.m@1006!

      2017-04-24 17:33:12.929 appledoc[16123:2906082] *** Assertion failure in +[GBMethodData methodDataWithType:result:arguments:], /Users/kangxg/Downloads/appledoc-master/Model/GBMethodData.m:44

      Oops, something went wrong...

      NSInternalInconsistencyException: Invalid parameter not satisfying: [arguments count] >= 1

        @ 0   CoreFoundation                      0x00007fffb5228e7b __exceptionPreprocess + 171

        @ 1   libobjc.A.dylib                     0x00007fffc9e09cad objc_exception_throw + 48

        @ 2   CoreFoundation                      0x00007fffb522db82 +[NSException raise:format:arguments:] + 98

        @ 3   Foundation                          0x00007fffb6c77d50 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195

        @ 4   appledoc                            0x000000010c41ca9c appledoc + 146076

        @ 5   appledoc                            0x000000010c410d8e appledoc + 97678

        @ 6   appledoc                            0x000000010c416346 appledoc + 119622

        @ 7   appledoc                            0x000000010c41079b appledoc + 96155

        @ 8   appledoc                            0x000000010c40d75b appledoc + 83803

        @ 9   appledoc                            0x000000010c40d66f appledoc + 83567

        @ 10  appledoc                            0x000000010c416346 appledoc + 119622

        @ 11  appledoc                            0x000000010c416167 appledoc + 119143

        @ 12  appledoc                            0x000000010c40d5ef appledoc + 83439

        @ 13  appledoc                            0x000000010c40d1d4 appledoc + 82388

        @ 14  appledoc                            0x000000010c410347 appledoc + 95047

        @ 15  appledoc                            0x000000010c40d947 appledoc + 84295

        @ 16  appledoc                            0x000000010c40abff appledoc + 72703

        @ 17  appledoc                            0x000000010c40860f appledoc + 62991

        @ 18  appledoc                            0x000000010c409dca appledoc + 69066

        @ 19  appledoc                            0x000000010c4099d3 appledoc + 68051

        @ 20  appledoc                            0x000000010c409c05 appledoc + 68613

        @ 21  appledoc                            0x000000010c409c05 appledoc + 68613

        @ 22  appledoc                            0x000000010c409c05 appledoc + 68613

        @ 23  appledoc                            0x000000010c409c05 appledoc + 68613

        @ 24  appledoc                            0x000000010c40957d appledoc + 66941

        @ 25  appledoc                            0x000000010c4082b9 appledoc + 62137

        @ 26  appledoc                            0x000000010c3fcc0c appledoc + 15372

        @ 27  appledoc                            0x000000010c3fb353 appledoc + 9043

        @ 28  appledoc                            0x000000010c3fb4a7 appledoc + 9383

        @ 29  appledoc                            0x000000010c3fb633 appledoc + 9779

        @ 30  appledoc                            0x000000010c3fa938 appledoc + 6456

      这时候 并没有 生成 docset-installed.txt 文件 如果是操作第一种方法 生成了此文件,打开此文件
    • 文件内容为
    • Documentation set was installed to Xcode! Path: /Users/kangxg/Library/Developer/Shared/Documentation/DocSets/com.etiantian.ettAiXuePaiNextGen.ettAiXuePaiNextGen.docset Time: 2017-04-24 09:02:18 +0000
    • 按照路径 找到文件 但是并没有出现 下图中
    • Objective-C 自动生成文档工具:appledoc 使用_第1张图片
    • html 文件,网上有很多例子,在小的测试demo中是没有问题的,但是如果你使用了cocospod 引入第三方库,问题就出现了,
    • 本来很简单的操作,让你苦恼怎么去解决,不用怕,这时候,你今天目录中文件目录中 按照上面的操作方法再操作一次,这时候,
    • 还会出现很多警告,不用管它,结尾处如果出现Generation step 4/4 failed: GBDocSetInstallGenerator failed generating output, aborting! Documentation set was installed, but couldn't reload documentation within Xcode. Expected end of line but found identifier. 就证明操作成功了。
    • 三 找到 docset-installed.txt 找到
    • Objective-C 自动生成文档工具:appledoc 使用_第2张图片
    • 右键 显示包内容
    •  Objective-C 自动生成文档工具:appledoc 使用_第3张图片
    • 这时候 看到了index.html 文件 双击打开
    • Objective-C 自动生成文档工具:appledoc 使用_第4张图片
    • 这时候 查看浏览项目文档了

你可能感兴趣的:(Objective-C 自动生成文档工具:appledoc 使用)