gpt4 book ai didi

xcode - 在没有 Apache Server/(.htaccess) 的情况下运行 Xcode DocC

转载 作者:行者123 更新时间:2023-12-04 07:29:06 24 4
gpt4 key购买 nike

在 DocC 文档中,"Distributing Documentation to External Developers" , Apple 提供了文档以在您的网站上托管文档存档。不幸的是,当我打开 .doccarchive/index.html 时,我只看到一个白页。他们只显示了 Apache 服务器的指南。他们指定使用 .htaccess 文件,并使用 RewriteRule .* SlothCreator.doccarchive/$0 [L] 在用户访问文档页面时重写 URL。

有没有办法在不运行 Apache 服务器的情况下打开文档 Web 应用程序? (我不想进行任何特定于机器的配置,例如修改 /etc/hosts)。最好能够将其作为静态站点托管(例如在 Github 页面、Cloudflare 页面、Netlify 等上)

编辑:@Ranoiaetep 的 answer ,我已经构建并将其推送到 GitHub repo可以通过 Netlify 网站查看:https://xcode-docc.netlify.app/documentation/

最佳答案

截至目前,我认为没有任何选项可以将其托管为静态站点。

然而,通过设置 .toml 文件将其托管在 Netlify 上非常容易:

[build]
publish = "ProjectName.doccarchive/"
###### Change it to your doccarchive file's name

[[redirects]]
from = "/documentation/*"
status = 200
to = "/index.html"

[[redirects]]
from = "/tutorials/*"
status = 200
to = "/index.html"

[[redirects]]
from = "/data/documentation.json"
status = 200
to = "/data/documentation/projectname.json"
###### Change it to name in ProjectName.doccarchive/data/documentation/...
# often just all lowercase of your project name

[[redirects]]
force = true
from = "/"
status = 302
to = "/documentation/"

[[redirects]]
force = true
from = "/documentation"
status = 302
to = "/documentation/"

[[redirects]]
force = true
from = "/tutorials"
status = 302
to = "/tutorials/"

关于xcode - 在没有 Apache Server/(.htaccess) 的情况下运行 Xcode DocC,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68048298/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com