为什么Sphinx会生成json?

发布于 2024-08-21 20:19:10 字数 108 浏览 5 评论 0原文

我注意到 Sphinx 能够生成 JSON 格式的文档。这些文件有什么用?

I notice that Sphinx has the ability to generate documentation in JSON. What are these files used for?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

软糯酥胸 2024-08-28 20:19:11

正如 文档 所说,

用于网络应用程序的使用(或
自定义后处理工具)
不使用标准 HTML
模板。

json 是一种与语言无关的数据交换的好简单方法,所以,为什么不呢?-)

As the docs say, it's

for use of a web application (or
custom postprocessing tool) that
doesn’t use the standard HTML
templates.

json's a good simple way for language-agnostic data interchange, so, why not?-)

纵山崖 2024-08-28 20:19:11

我假设您正在谈论 SerializingHTMLBuilder,其中在这种情况下,我认为答案可能是头脑中不一定有特定的目的。相反,许多东西提供了各种带有“加载/转储”API 约定的转换例程,以及 json 模块(在 2.6 中引入标准库之前称为 simplejson)只是许多此类软件包之一。

想必有些人更愿意出于自己的目的使用 JSON 格式的数据。如果我试图构建某种动态 Javascripty 文档系统,我可以想象选择使用 JSON 作为以可管理的格式从后端将文档获取到客户端的方式,如果由于某种原因 HTML 或 XML 没有似乎是更好的选择。

I assume you're talking about the SerializingHTMLBuilder, in which case I think the answer might be that there isn't necessarily a specific purpose in mind. Rather many things provide conversion routines of various kinds with a "loads/dumps" API convention, and the json module (known as simplejson before it was brought standard library in 2.6) is but one of many such packages.

Presumably some people would prefer to work with data in JSON format for their own purposes. If I were trying to build some sort of dynamic Javascripty documentation system, I could well imagine choosing to use JSON as the way to get documentation from the backend out to the client in a manageable format, if for some reason HTML or XML didn't seem like the better option.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文