如果我使用 DOT & ,如何更改 graphviz 创建的图表在 HTML 中的位置多氧?
我在 doxygen 中使用 dot 和 Graphviz 以 HTML 格式创建代码的用户手册。 doxygen 代码看起来有点像这样:
/**<br>
*@addtogroup MainProgram
* @dot
* digraph G {
* Main [label = "Main()"];
* START [label = "Start"];
* FINISH [label = "Finish"];
*
* START -> Main;
* Main -> FINISH;
* }
*
* @enddot
*/
这当然会生成一张漂亮的图片。不幸的是,图片在 HTML 页面中没有按照我想要的方式显示。它始终位于页面中央。我希望对齐方式位于页面的左侧。生成的 HTML 代码如下所示:
<div align="center">
<img src="inline_dotgraph_2.dot.gif" alt="inline_dotgraph_2.dot" border="0" usemap="#inline_dotgraph_2.dot.map">
<map name="inline_dotgraph_2.dot.map" id="inline_dotgraph_2.dot.map"></map>
</div>
谁能帮我吗?这要么是 doxygen 问题,要么是 graphiz/dot 问题。我似乎找不到答案。
谢谢,
莫里斯
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以通过将 CSS 文件分配给 doxygen 配置文件中的
HTML_EXTRA_STYLESHEET
来自定义 html 布局:You could customize the html layout by assign a CSS file to
HTML_EXTRA_STYLESHEET
in your doxygen configuration file:Doxygen 生成..导致居中的部分,因此这是一个 doxygen 问题。
如果 doxygen 使用 div 的类会更好,这样您就可以通过自定义样式表自定义布局(doxygen 支持通过 HTML_STYLESHEET 进行自定义)。我建议为此在错误跟踪器中提交错误报告(请参阅 https://bugzilla。 gnome.org/enter_bug.cgi?product=doxygen)。
Doxygen generates the <div align="center">..</div> section which causes the centering, so it is a doxygen problem.
Would have been better if doxygen used a class for the div instead, so that you could customize the layout via a custom stylesheet (doxygen supports customization via HTML_STYLESHEET). I suggest to submit a bug report in the bug tracker for this (see https://bugzilla.gnome.org/enter_bug.cgi?product=doxygen).
创建 HTML 输出后,在文本编辑器中打开 doxygen.css 文件。
搜索并编辑以下内容:
将“center”更改为“left”。
将之前的 doxygen.css 替换为这个新文件。
接下来重新加载 doxygen 生成的 index.html 文件。 (突出显示地址栏中的内容并按 Enter 键)。
图像将左对齐。
Once the HTML output has been created, open the doxygen.css file in a text editor.
Search and edit the following:
Change 'center' to 'left'.
Replace the previous doxygen.css with this new file.
Next reload the index.html file that was generated by doxygen. (Highlight the contents in the address bar and press enter).
Images will be left justified.