sphinx生成类模块概述 [英] sphinx generate class modules overview

查看:198
本文介绍了sphinx生成类模块概述的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



我无法找到狮身人面像如何做到这一点



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



有没有什么办法可以做到这一点sphinx直接或者一些hack使它作为doxygen模块概述工作?

解决方案

Sphinx有一个内置的扩展名 sphinx.ext.inheritance_diagram 使用Graphviz。它定义了一个指令: inheritance-diagram 。下面是一个如何在.rst文件中使用它的例子:
$ b

  ..继承-diagram :: mymodule.MyClass1 mymodule.MyClass2 
:parts:1

这里有一些由Sphinx生成的文档中的继承图示例:

>




还有一个通用 sphinx.ext.g raphviz 扩展名,用于在图表中嵌入图表。


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

I can't find how sphinx can do that

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.

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

解决方案

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

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


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

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆