【问题标题】:How to create link to an embedded image in doxygen markdown如何在 doxygen markdown 中创建嵌入图像的链接
【发布时间】:2019-07-10 01:14:57
【问题描述】:

对于我在 SO(或其他任何地方)上寻找的内容,我找不到任何答案。我的 markdown 文件中有一个嵌入图像,供 doxygen 使用,如下所示:

# 2. Example Markdown {#exMd}

This is a test to show an image

![imgDef]

[imgDef]: @ref SettingsValidationCollaborationDiagram.jpg "Diagram Caption"

## Some Other Section

This is a test to put a link to the image above.  See [here](@ref imgDef)

请参阅下面的屏幕截图了解我想要发生的事情:

如果我单击此处,它将带我到页面中原始图像可见的部分。我想不出一种方法来制作锚点,或者其他一些机制来创建可以链接到图像附近的东西。

显然,现有代码会导致我出错,但我不知道如何插入指向图像的链接,而不仅仅是在该位置嵌入图像。

【问题讨论】:

  • 您使用的是哪个版本的 doxygen?如果不是当前版本(1.8.15),你可以试试这个吗?您能否发布一个完整的小示例来说明您的问题。
  • @albert 为问题添加了更多细节。我使用的是 1.8.14,但如果我不知道正确的语法来执行我所要求的操作,那不会有什么不同。

标签: markdown doxygen


【解决方案1】:

据我所知,无法以这种方式链接到图像。 这表示有可能通过\anchor 命令(在示例中我在 HTML cmets 中放置了一些额外的 cmets):

# 2. Example Markdown {#exMd}

This is a test to show an image

\anchor imgDef <!-- added line -->
![imgDef]

[imgDef]: SettingsValidationCollaborationDiagram.jpg "Diagram Caption" <!-- no need for the @ref here -->

## Some Other Section

This is a test to put a link to the image above.  See [here](@ref imgDef)

基于注释的一个小补充,来自文档:

\锚点

此命令将一个不可见的命名锚点放入文档中,您可以使用 \ref 命令参考。

【讨论】:

  • 谢谢@albert !!!我找不到有关如何使用锚点的任何信息,但您的解决方案非常适合我正在尝试做的事情!
猜你喜欢
  • 1970-01-01
  • 2015-09-26
  • 1970-01-01
  • 2015-10-12
  • 1970-01-01
  • 2017-12-07
  • 1970-01-01
  • 1970-01-01
  • 2010-10-21
相关资源
最近更新 更多