用AppleDoc来生成一份你的文档吧

来源:互联网 发布:网络直播危害的事例 编辑:程序博客网 时间:2024/05/16 18:27

用AppleDoc来生成一份你的文档吧

大约分为三步

  • 去GitHub下载AppleDoc
  • 安装AppleDoc
  • 配置AppleDoc

下载

下载就不多解释了,打开上面的超链接,然后DownLoad到本地

安装

把下载来的zip解压掉,然后打开终端,cd到解压的appledoc目录
输入以下命令

sudo sh install-appledoc.sh

接下来输入以下你的密码,然后就ok了。

配置

  1. 新建一个iOS project,然后打开终端cd到这个project的目录
  2. 假设你这个project叫MyPj,你的公司名字是Company输入以下命令
    appledoc --project-name MyPj --project-company Company ./
    这时候你应该会在project的根目录下发现一个docset-installed.txt,不用管
  3. 打开你的project,然后去新建一个target,类别选择other里的Aggregate. 然后选中这个target,去选择右边的Build Phases ,选择点选左上的+,选择new run script
  4. 把下面的代码复制进黑色的框框里
    company="Company";
    companyID="com.Company";
    companyURL="http://Company.com";
    target="iphoneos";
    outputPath="~/help";
    /usr/local/bin/appledoc \
    --project-name "${PROJECT_NAME}" \
    --project-company "${company}" \
    --company-id "${companyID}" \
    --docset-atom-filename "${company}.atom" \
    --docset-feed-url "${companyURL}/${company}/%DOCSETATOMFILENAME" \
    --docset-package-url "${companyURL}/${company}/%DOCSETPACKAGEFILENAME" \
    --docset-fallback-url "${companyURL}/${company}" \
    --output "${outputPath}" \
    --publish-docset \
    --docset-platform-family "${target}" \
    --logformat xcode \
    --keep-intermediate-files \
    --no-repeat-first-par \
    --no-warn-invalid-crossref \
    --exit-threshold 2 \
    "${PROJECT_DIR}"

    Command + R 运行一下

  5. 打开刚才的ocset-installed.txt,这里边有个路径,把这个路径复制下来,然后打开你的资源管理器(Finder)Shift+Command+G ,粘贴进去,右键显示包内容,然后层层点进目录,你会发现有一个index.html.这个就是你生成的AppleDoc了。

    至于这个注释应该怎么写大家去看看官方那边的注解吧

原创粉丝点击