【问题标题】:Use appledoc to generate documentation for some particular classes使用 appledoc 为某些特定类生成文档
【发布时间】:2014-02-25 11:33:11
【问题描述】:

我编写了一个简单的可重用控件,并在寻找一种记录其功能和属性的方法时,我发现了这个有用的工具,名为 - appledoc。

我创建了一个演示项目来展示我的控件的功能。现在,当我使用 appledoc 生成文档时,它也为演示类创建了引用。我不想要这个。我期望 appledoc 仅为我的可重用类生成文档。我怎么能这样做?

我的运行脚本是这样的:

APPLEDOC_PATH=`which appledoc`
if [ $APPLEDOC_PATH ]; then
$APPLEDOC_PATH \
--project-name "MyControl" \
--project-company "Company Name" \
--company-id "" \
--output ${PRODUCT_NAME}Docs \
--keep-undocumented-objects \
--keep-undocumented-members \
--keep-intermediate-files \
--no-repeat-first-par \
--no-warn-invalid-crossref \
--ignore "*.m,AppDelegate.h,ViewController.h" \
--exit-threshold 2 \
${PROJECT_DIR}/${PRODUCT_NAME}
fi;

尝试在 --ignore 标记中添加我的 AppDelegateViewController 类,但它似乎不起作用。我在这里有什么遗漏吗?

【问题讨论】:

    标签: ios xcode appledoc


    【解决方案1】:

    尝试重复--ignore 标志,

    --ignore .m \
    --ignore AppDelegate.h \
    --ignore ViewController.h \
    

    希望有帮助!

    【讨论】:

    • 是的..这确实有帮助..它有效。你知道反向方法吗?我的意思是,不要忽略其余的类,只需包含所需的类。 appledoc中有什么可用的吗?
    • @HRM 我认为它会拾取所有文件,除非您指定要忽略的文件。
    【解决方案2】:

    就我而言,我通常只为我的模型创建文档,而忽略我的 PODS 和所有视图控制器。

    看看我是怎么设置的:

    APPLEDOC_PATH=`which appledoc`
    if [ $APPLEDOC_PATH ]; then
        $APPLEDOC_PATH \
        --project-name "My APP" \
        --project-company "My Company Name" \
        --company-id "" \
        --output "PATH DIR" \
        --keep-undocumented-objects \
        --keep-undocumented-members \
        --keep-intermediate-files \
        --no-repeat-first-par \
        --no-warn-invalid-crossref \
        --ignore ".m" \
        --ignore "Pods" \
        --ignore "*Controller.h" \
        --ignore "*Cell.h" \
        --explicit-crossref \
        --keep-undocumented-objects \
        --keep-undocumented-members \
        --use-single-star \
        --no-repeat-first-par \
        --no-warn-missing-arg \
        --no-warn-undocumented-object \
        --no-warn-undocumented-member \
        --no-warn-empty-description \
        --exit-threshold 2 \
        ${PROJECT_DIR}/${PRODUCT_NAME}
    fi;
    

    我忽略了所有这些文件:

        --ignore ".m" \             #all my .m files
        --ignore "Pods" \           # All my PODS
        --ignore "*Controller.h"  \ # any controlers (a.k.a ViewController, TablewViewController, CollectionViewController )
        --ignore "*Cell.h" \        # Any cell (a.k.a UITableViewCell, UICollectionViewCell)
    

    【讨论】:

      猜你喜欢
      • 2012-04-06
      • 2012-04-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多