sphinx 生成类模块概述

编程入门 行业动态 更新时间:2024-10-26 17:22:39
本文介绍了sphinx 生成类模块概述的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我希望 sphinx 生成一个类似于 doxygen 生成的模块概述,这里是一个示例

I'd like sphinx to generate a module overview similar to the one generated by doxygen, here is an example

我不知道 sphinx 是怎么做到的

I can't find how sphinx can do that

我可以使用 Graphviz 来生成某种图形,但我找不到一种方法可以在图形中获取与上述示例相同的操作方式的可点击对象.

I could use Graphviz to generate some sort of graph, but I can't find a way to get a clickable object in the graph that operates in the same way as the example above.

有什么办法可以直接在 sphinx 中做到这一点,或者通过一些 hack 使其作为 doxygen 模块概述工作吗?

Is there any way to do that in sphinx directly or some hack to make it work as the doxygen module overview?

推荐答案

Sphinx 有一个内置的 扩展 称为 sphinx.ext.inheritance_diagram使用Graphviz.它定义了一个指令:inheritance-diagram.以下是如何在 .rst 文件中使用它的示例:

Sphinx has a built-in extension called sphinx.ext.inheritance_diagram that uses Graphviz. It defines one directive: inheritance-diagram. Here is an example of how you could use it in an .rst file:

.. inheritance-diagram:: mymodule.MyClass1 mymodule.MyClass2
   :parts: 1

以下是 Sphinx 生成的文档中继承图的一些示例:

Here are some examples of inheritance diagrams in documents generated by Sphinx:

http://matplotlib/1.3.1/devel/documenting_mpl.html#inheritance-diagramshttp://openalea.gforge.inria.fr/doc/vplants/PlantGL/doc/_build/html/user/math.html#class-inheritance-diagram

还有一个通用的"sphinx.ext.graphviz 扩展,用于在文档.

There is also a "generic" sphinx.ext.graphviz extension for embedding graphs in documentation.

这篇关于sphinx 生成类模块概述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-01 09:15:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/826544.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模块   sphinx

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!