将图像添加到 Doxygen

问题描述 投票:0回答:1

我正在尝试将图像添加到 doxygen .md 文件。很简单。
它需要有一个标题。很简单。
它需要左对齐。呃。这就是我挣扎的地方。
我可以添加标题或左对齐图像,但我没有尝试过这两种方法。 我尝试过的

![Caption](my_image.png "Caption")

给我一个标题,但居中

 <img src="my-image.jpg" align="left">
 <div style="clear: both"></div>

左对齐但没有标题

 <img src="my-image.jpg" align="left" title="Caption">
 <div style="clear: both"></div>

左对齐,工具提示,仍然没有标题。

最后这个给了我一个左对齐的图像,标题左对齐,但我真正想要的是标题以图像为中心,然后整个图像左对齐

<div class="image">
    <img src="Simulation-Client.png" alt="Simulation-Client.png" align="left">
    <div style="clear: both"></div>
</div>
<div class="caption" align="left">Simulation Client Architecture</div>
<div style="clear: both"></div>
<Br />

确实必须有一种更简单的方法来做我想做的事。
注意我不是特别擅长 html,所以我不想要 CSS 解决方案。

html image alignment doxygen caption
1个回答
0
投票

这似乎是 Doxygen 1.9.6 中的一个错误。当使用来自主题

InputIMAGE_PATH时,会生成不同的HTML标签。下面是我的 *.md 文件,仅用于测试用例。您将在此降价代码中找到使用表格的解决方案(Bilal Gultekin 的致谢:https://stackoverflow.com/a/45191209/1981088)。

This is a regular paragraph.

![test for image 1](images/help-info_helpware_artLogo.png "Tool Tip Title Caption 1")

![test for image 2][2]

This is another regular paragraph.

## HTMLHelp
### Information about Microsoft HTMLHelp

HTMLHelp, developed by Microsoft, is a help system used to create locally stored technical documentation and help for application software based on Hypertext Markup Language (HTML). The HTMLHelp Workshop is used to compile the content into a compressed help file with the file extension CHM.

This is a regular paragraph.

| ![HTMLHelp Workshop - steps to set default page][1] | 
|:--:| 
| *HTMLHelp Workshop - steps to set default page* |

This is another regular paragraph.

IMAGE_PATH
未使用

但是,这样做的缺点是必须手动将图像文件复制到 Doxygen 输出的 HTML 的目标文件夹中。这导致(默认左对齐):

来自这个生成的 HTML:

<p>This is a regular paragraph.</p>
<p><img src="images/help-info_helpware_artLogo.png" alt="test for image 1" title="Tool Tip Title Caption 1" class="inline"/></p>
<p><img src="images/help-info_helpware_artLogo.png" alt="test for image 2" title="Tool Tip Title Caption 2" class="inline"/></p>
<p>This is another regular paragraph.</p>

IMAGE_PATH
使用中

来自这个生成的 HTML:

<p>This is a regular paragraph.</p>
<div class="image">
<img src="help-info_helpware_artLogo.png" alt=""/>
<div class="caption">
Tool Tip Title Caption 1</div></div>
    <div class="image">
<img src="help-info_helpware_artLogo.png" alt=""/>
<div class="caption">
test for image 2</div></div>
    <p>This is another regular paragraph.</p>

您需要根据自己的需要决定要尝试什么。我的图像位于 Doxygens 目标文件夹的子文件夹

images
中。

© www.soinside.com 2019 - 2024. All rights reserved.