Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
475 views
in Technique[技术] by (71.8m points)

documentation - How do I link between markdown documents in doxygen?

I have a project with a set of markdown pages that are interlinked with links such as

[Go to this page](subdir/MyOtherPage.md)

The pages all get picked up by doxygen and appear in the output, but the links are not altered to point to their new html renditions.

I could change the links to point to the html pages, but my project is hosted on github and then those links would become broken since github supports linking between markdown pages automatically.

I can't see anything in the doxygen documentation about supporting links other than external ones. Is there any way to make doxygen produce an HTML link from a markdown one?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

As per Doxygen 1.8.7 there are three ways to do this:

  • Use a standard markdown hyperlink as described in your original question.
  • Use a @ref and prefix the target with md_ along with any subdirectories.
  • Name the page and use @ref to refer to the name.

The first method is straightforward and this will also work without Doxygen (e.g. when browsing your code repository on Github).

[Go to this page](subdir/MyOtherPage.md)

Whereas the second method you'll need to link it like this:

[Go to this page](@ref md_subdir_MyOtherPage)

Apparently this also is the way prescribed by the Doxygen's primary author.

Lastly in the third method you'll need to have a name for the target page and then link to that name. Example:

In MyOtherPage.md have this as the header

# My Other Page Title {#MyOtherPageName}

then link it like so

[Go to this page](@ref MyOtherPageName)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...