在Doxygen主页中使用Markdown图像的异常行为

时间:2018-03-20 13:47:52

标签: image svg markdown doxygen

对于我的Doxygen生成文档,我打算重用我的README.md作为我的主页。这在大多数情况下效果很好,但由于某种原因,它不适用于Markdown图像。通过降价图像,我的意思是SVG,如:

Travis Build Status

此类图片的降价是:

[![Travis Build Status](https://travis-ci.org/arnavb/cpp14-project-template.svg?branch=master)](https://travis-ci.org/arnavb/cpp14-project-template)

然而,当我尝试在Doxygen中显示它时,我的输出类似于:

Actual output

如您所见,图像被解释为只是指向相应网站的链接。为了尝试解决这个问题,我决定暂时删除图片的链接。但是,当我这样做时,新输出是:

Not much better

现在,虽然图像可见:

  1. 我无法点击它们访问各自的网站。
  2. 图像有这种奇怪的中心对齐,我没有在任何地方指定。
  3. 这很糟糕,因为我不想为Doxygen主页创建单独的文档,只是使用我的普通README.md。除了图像之外,所有其他Markdown都呈现出完美的渲染效果。我不知道为什么。我正在使用Doxygen 1.8.8,这是我的完整Markdown(没有链接):

    # Project Name
    
    ![Travis Build Status](https://travis-ci.org/arnavb/cpp14-project-template.svg?branch=master)
    ![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/qvt257817g7c66m9/branch/master?svg=true)
    ![Documentation](https://codedocs.xyz/arnavb/cpp14-project-template.svg)
    ![Codacy Badge](https://api.codacy.com/project/badge/Grade/1c76469660ca411fa1f92ce0ef0c5cd3)
    
    A simple template I plan on using for all of my C++14 projects.
    
    # Test header
    
    ## Nested header
    
    ### lol
    
    > Blockquote
    

    以下是上面标记的生成HTML:

    <div class="image">
    <img src="https://travis-ci.org/arnavb/cpp14-project-template.svg?branch=master"  alt="Travis Build Status"/>
    </div>
     <div class="image">
    <img src="https://ci.appveyor.com/api/projects/status/qvt257817g7c66m9/branch/master?svg=true"  alt="Appveyor Build Status"/>
    </div>
     <div class="image">
    <img src="https://codedocs.xyz/arnavb/cpp14-project-template.svg"  alt="Documentation"/>
    </div>
     <div class="image">
    <img src="https://api.codacy.com/project/badge/Grade/1c76469660ca411fa1f92ce0ef0c5cd3"  alt="Codacy Badge"/>
    </div>
    <p>A simple template I plan on using for all of my C++14 projects.</p>
    <h1>Test header</h1>
    <h2>Nested header</h2>
    <h3>lol</h3>
    <blockquote class="doxtable">
    <p>Blockquote</p>
    </blockquote>
    

    作为比较,这里是SVG作为链接的降价:

    <div class="contents">
    <div class="textblock"><p><a href="https://travis-ci.org/arnavb/cpp14-project-template">![Travis Build Status](https://travis-ci.org/arnavb/cpp14-project-template.svg?branch=master)</a> <a href="https://ci.appveyor.com/project/arnavb/cpp14-project-template/branch/master">![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/qvt257817g7c66m9/branch/master?svg=true)</a> <a href="https://codedocs.xyz/arnavb/cpp14-project-template/">![Documentation](https://codedocs.xyz/arnavb/cpp14-project-template.svg)</a> <a href="https://www.codacy.com/app/arnavb/cpp14-project-template?utm_source=github.com&amp;amp;utm_medium=referral&amp;amp;utm_content=arnavb/cpp14-project-template&amp;amp;utm_campaign=Badge_Grade">![Codacy Badge](https://api.codacy.com/project/badge/Grade/1c76469660ca411fa1f92ce0ef0c5cd3)</a></p>
    <p>A simple template I plan on using for all of my C++14 projects.</p>
    <h1>Test header</h1>
    <h2>Nested header</h2>
    <h3>lol</h3>
    <blockquote class="doxtable">
    <p>Blockquote</p>
    </blockquote>
    </div></div><!-- contents -->
    

    其图像标记:

    [![Travis Build Status](https://travis-ci.org/arnavb/cpp14-project-template.svg?branch=master)](https://travis-ci.org/arnavb/cpp14-project-template)
    [![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/qvt257817g7c66m9/branch/master?svg=true)](https://ci.appveyor.com/project/arnavb/cpp14-project-template/branch/master)
    [![Documentation](https://codedocs.xyz/arnavb/cpp14-project-template.svg)](https://codedocs.xyz/arnavb/cpp14-project-template/)
    [![Codacy Badge](https://api.codacy.com/project/badge/Grade/1c76469660ca411fa1f92ce0ef0c5cd3)](https://www.codacy.com/app/arnavb/cpp14-project-template?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=arnavb/cpp14-project-template&amp;utm_campaign=Badge_Grade)
    

    我应该改变什么来让这些Markdown SVG在Doxygen中正确渲染?

1 个答案:

答案 0 :(得分:0)

从Doxygen 1.8.18开始,原始问题似乎已解决。

如以上评论所述,如果无法进一步升级,则可以使用自1.8.15起的内联html。