Xcode常用外掛使用及自動生成幫助文件
*一、Xcode 外掛下載:*
VVDocumenter下載: https://github.com/onevcat/VVDocumenter-Xcode
Xcode常用外掛下載:http://pan.baidu.com/s/1sjLnUFj
*二、VVDocumenter安裝方法:*
The best way of installing is by Alcatraz. Install Alcatraz followed by the instruction, restart your Xcode and press ⇧⌘9. You can find VVDocumenter-Xcode in the list and click the icon on left to install.
If you do not like the Alcatraz way, you can also clone the repo. Then build the VVDocumenter-Xcode target in the Xcode project and the plug-in will automatically be installed in ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins. Relaunch Xcode and type in /// above any code you want to write a document to.
If you want to use other text beside of /// to trigger the document insertion, you can find a setting panel by clicking VVDocument in the Window menu of Xcode. You can also find some other useful options there, including setting using spaces instead of tab in the panel or changing the format of generated documentation.
開發中我遇到的問題:下載Xcode常用外掛並解壓至~/Library/Application Support/Developer/Shared/Xcode/Plug-ins,Xcode6.2下其它外掛均可使用,唯獨VVDocumenter不行。百思不得其解。後來安裝了Alcatraz,VVDocumenter才能使用。
*三、appledoc安裝方法:*
- appledoc下載:https://github.com/tomaz/appledoc
- appledoc安裝:
The recommended way is to clone GitHub project and compile the tool from Xcode. As cloning GitHub project will create the link to the main repository, it greatly simplifies future upgrading too. To install, type the following in the Terminal:
git clone git://github.com/tomaz/appledoc.git
This creates appledoc directory. Within you can find appledoc.xcodeproj Xcode project; open it and compile appledoc target - this should work out of the box, however your system must meet minimum system requirements, see below. I recommend you copy resulting appledoc executable from build directory to one of the directories in your path (echo $PATH) to make it easily accessible.
Optional: Appledoc is selfcontained and contains the necessary template files. IF you want to modify these default from Templates subdirectory to one of the expected locations:
~/Library/Application Support/appledoc
~/.appledoc
You can also use install-appledoc.sh script to perform quick installation. Open Terminal and switch to appledoc directory. Type following command:
sudo sh install-appledoc.sh (if you need templates add ‘-t default’)
It compiles appledoc and installs its binary to /usr/local/bin and templates (if wanted) to ~/.appledoc by default. You can override this directories with -b and -t options respectively. For example:
sudo sh install-appledoc.sh -b /usr/bin -t ~/Library/Application\ Support/appledoc
Alternatively with Homebrew:
brew install appledoc
Homebrew does not install templates by default.
*四、appledoc整合Xcode:*
- Select top of your project in Project Navigator
- Click Add Target
- Depending on your project type (iOS or OS X) choose Aggregate Template
- Create new target. I suggest to call it Documentation
- Click on Build Phases and add new Build Phase based on Script
- Paste the script below into the script window
- Adjust variables in section “Start Constants” as required
- Uncomment correct ‘target’ for your project and comment out another one depending on your project type.
- Adjust path to appledoc binary and appledoc’s command-line switches if required
- When you ready to generate a docset from your project, build Documentation target.
- Docset will be installed into new loction and will become available to Xcode immediately.
- To refresh Quick Help (ALT+Click) and (ALT+double-click) you may need to restart Xcode to refresh its index cache.
Below is a working script that can be added to the Xcode Build Phases, Run Script
#appledoc Xcode script
# Start constants
company="ACME";
companyID="com.ACME";
companyURL="http://ACME.com";
target="iphoneos";
#target="macosx";
outputPath="~/help";
# End constants
/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}"
注:target=”iphoneos”,引號裡內容換成你的工程target名,否則build會有錯。Build成功後,在Xcode開啟 -> help -> Documentation And API Reference,即可檢視生產的工程幫助文件。此方法一。
*五、appledoc使用方法(命令列控制)*
在命令列工具cd到工程所在路徑,然後鍵入
appledoc --output ./doc --project-name spring3g_v525_test --project-company "spring3s" --company-id "com.ch" .
或者
appledoc --no-create-docset --output ./doc --project-name spring3g_v525_test --project-company "spring3s" --company-id "com.ch" .
這樣在工程目錄下即生成doc資料夾。doc資料夾下有註釋網頁文件。
注:”.“ 和前面的符號一定要加 空格 否則就會報錯。–company-id引數也要傳。新增–no-create-docset引數,會在./doc目錄下生成網頁文件。./doc目錄下docset-installed.txt檔案記錄了生成help Documentation儲存路徑。
*六、appledoc Demo*
Demo下載:https://github.com/JarryChang/AppledocDemo
*七、參考連結:*
相關文章
- 怕寫文件?AI自動生成程式碼文件的外掛AI
- IDEA外掛Apifox,一鍵自動生成介面文件!IdeaAPI
- 程式碼自動生成外掛:
- 工具篇---xcode外掛使用XCode
- changelog 日誌自動生成外掛
- JavaWeb名詞解釋及幫助文件JavaWeb
- Linux幫助文件Linux
- jdk幫助文件JDK
- 幫助文件(五)
- Apple開發_Xcode內還有幫助程式碼自動排版的工具嗎?APPXCode
- VSCODE 常用外掛及配置VSCode
- maven mybatis-generator 外掛自動生成程式碼MavenMyBatis
- jQuery 幫助文件 apijQueryAPI
- 部落格幫助文件
- 平臺幫助文件
- 學院幫助文件
- 論壇幫助文件
- kafka官方幫助文件Kafka
- 自動生成介面文件coreapiAPI
- showdoc 自動生成 API 文件API
- DRF 自動生成介面文件
- vscode自動註釋外掛的使用VSCode
- ELK相關幫助文件
- api和api幫助文件API
- fastclick外掛的使用--移動端vue專案開發(vue常用外掛)ASTVue
- .NET6使用DOCFX自動生成開發文件
- 擼一個 webpack 外掛,希望對大家有所幫助Web
- 利用apidoc自動生成model文件API
- Git檢視本地幫助文件Git
- 替換NULL值幫助文件Null
- Linux設定中文幫助文件、常見目錄、幫助命令Linux
- Eclipse安裝lombok外掛及外掛使用案例EclipseLombok
- Vim常用外掛安裝及配置方法
- 使用go-swagger為golang API自動生成swagger文件SwaggerGolangAPI
- IDEA 外掛上新! 生成介面文件就是這麼快!Idea
- Xcode外掛: 編碼效率神器 FlyCodingXCode
- 幾行shell幫你的xcode迅速自動批量打包ipaXCode
- 如何利用showdoc自動生成API文件API
- java 文件自動生成的神器 idocJava