docutils 和 Sphinx 之间有什么关系?

发布于 2024-08-25 10:08:58 字数 108 浏览 9 评论 0原文

Python 似乎有很多文档工具。我遇到的另一个是 epydoc。看起来 Sphinx 是事实上的标准,因为它用于生成官方 Python 文档。有人可以帮我整理一下 Python 文档工具的当前状态吗?

There seems to be a plethora of documentation tools for Python. Another one that I've run across is epydoc. It seems like Sphinx is the de facto standard, because it's used to generate the official Python docs. Can someone please sort out the current state of Python's documentation tools for me?

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

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

发布评论

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

评论(3

可可 2024-09-01 10:08:58

epydocSphinx 是不同类型的工具。

它们的相同之处在于:

  • 都通过 ReST 使用/docutils.sourceforge.net/" rel="nofollow noreferrer">docutils。
  • 两者的重点都非常 Pythonic
  • 都可以生成 HTML 和 PDF 文档

他们的重点不同。

  • Epydoc 专注于 API(开发人员)文档。使用 Epydoc,您可以更快地获得更多结果。你把它指向你的源代码,你就会得到一些东西。这就是我想要的 API 文档工具。
  • Sphinx 专注于一般(用户)文档。虽然 Sphinx 确实从源代码中提取了大量信息,但您需要在其中添加更多信息。 Sphinx 可以生成 API 文档,但是它并不那么简单,而且 IMO 的表现不如 Epydoc。我知道有些人会不同意,因为 Sphinx 是为 Python 选择的。但是,这取决于您想投入多少工作。我确实喜欢 Sphinx 的一般文档。

因此,这取决于您想要投入多少工作以及您要记录的内容。

epydoc and Sphinx are different types of tools.

They are the same in that they:

  • Both use ReST via docutils.
  • Both are very Pythonic in their focus
  • Both can generate HTML and PDF documentation

They are different in their focus.

  • Epydoc is focused on API (Developer) documentation. You get more results quicker with Epydoc. You point it at your source code and you get something. This is what I want from an API documentation tool.
  • Sphinx is focused on general (User) documentation. While Sphinx does pull a lot of information from your source code you need to put a little more into it. Sphinx can generate API documentation but, it's not as straight forward, and IMO doesn't do as good of a job as Epydoc. I know some will disagree because Sphinx is chosen for Python. BUT, it depends on how much work you want to put into it. I do love Sphinx for general documentation.

So it depends on how much work you want to put into it and what you are documenting.

何必那么矫情 2024-09-01 10:08:58

最近从Python2换成了Python3,发现没有Python3的Epydoc包。因此,Python3 似乎明确关注使用 Sphinx 作为 API 文档。

I recently changed from Python2 to Python3 and found that there was no Epydoc package for Python3. So it seems with Python3 there is a clear focus on using Sphinx as API documentation.

亽野灬性zι浪 2024-09-01 10:08:58

看起来Epydoc即使没有死,至少也对峡湾充满了渴望。

使用 sphinx-apidoc 命令和 autodoc 扩展看起来是目前最流行的 API 文档选项。

很好的例子是:

请参阅:我们应该使用 Epydoc、Sphinx 还是其他东西来记录 Python API? (SO5579198)

Sphinx 鼓励比 javadoc 模式中的工具更具叙事性的风格,但这也许是一件好事?

It seems like Epydoc is, if not dead, at least pining for the fjords.

Sphynx with the sphinx-apidoc command and the autodoc extension looks to be the most popular option for API docs at this time.

Good examples are:

See: Should we use Epydoc, Sphinx or something else for documenting Python APIs? (SO5579198)

Sphinx encourages a more narrative style than tools in the javadoc mold, but maybe this is a good thing?

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