问题描述
Xcode 13 的 DocC 文档档案可以使用自定义 Apache .htaccess
文件托管,如 向外部开发人员分发文档 和 托管和自动化您的 DocC 文档 - WWDC21.
Xcode 13's DocC documentation archives can be hosted using a custom Apache .htaccess
file as described in Distributing Documentation to External Developers and Host and automate your DocC documentation - WWDC21.
为 SlothCreator 示例项目进行设置的步骤是什么?macOS/M1 Mac 以便您可以在浏览器中查看文档?
What are the steps to get that set up for the SlothCreator example project on a macOS / a M1 Mac so you can look at the documentation in the browser?
推荐答案
获取 SlothCreator 示例项目并在 Xcode 中构建文档存档或向外部开发人员分发文档中所述的命令行一个>
Get the SlothCreator example project and build the documentation archive in Xcode or the command line as described in Distributing Documentation to External Developers
通过 Homebrew 安装 httpd:
Install httpd via Homebrew:
brew install httpd
将
SlothCreator.doccararchive
复制到/opt/homebrew/var/www/
(路径适用于 M1 Mac)Copy
SlothCreator.doccarchive
to/opt/homebrew/var/www/
(paths are for M1 Macs)编辑
/opt/homebrew/etc/httpd/httpd.conf
:允许
AllowOverride All
用于 DocumentRoot 目录
Allow
AllowOverride All
for the DocumentRoot Directory
启用
LoadModule rewrite_module
编辑
/opt/homebrew/var/www/.htaccess
并使用 Apple 在 向外部开发人员分发文档Edit
/opt/homebrew/var/www/.htaccess
and use the example configuration as provided by Apple in Distributing Documentation to External Developers重启Apache:
sudo apachectl restart
您现在应该可以打开
http://localhost:8080/documentation/slothcreator/
和http://localhost:8080/tutorials/slothcreator/
You should now be able to open
http://localhost:8080/documentation/slothcreator/
andhttp://localhost:8080/tutorials/slothcreator/
享受吧!
这篇关于在 macOS 上通过 Apache 本地运行 Xcode DocC 文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!