1

Say I have a page, in the Related Pages section, named states.md.
Now, in the doc of a specific method, I want to tell users to go see that file for more details, like "See states.md", with an hyperlink to the page.

The problem is, I have no problem generating the link (I can use the \ref command like See the \ref states.md "states.md", but it seems to work the same if I just write the name of the file), however the link goes to a empty and useless page rather than the actual page :

Empty page titled "doc_files/states.md File Reference"

If I "manually" go to the Related Pages tab, states.md appears in the list, if I click on it from here I can see the content of the file.
How can I make Doxygen generate a link to the actual content of my file, like it appears in the Related Pages tab ?

albert
  • 8,285
  • 3
  • 19
  • 32
TwilCynder
  • 33
  • 6
  • Form the image I can see that you are using doxygen version 1.9.3 (good that is the latest release). To be able to give some advise what are the first few lines in the `states.md` is there e.g. a `\page` command or does the first line start wit `#` (so indicating a page? – albert Jan 04 '22 at 12:59
  • No, there isn't anything Doxygen-related in states.md (you can find the file here if you want : https://github.com/TwilCynder/kuribrawl/blob/master/c%2B%2B/doc_files/states.md I thought it was not a problem since Doxygen still detects states.md as a page, and includes it in the Related Pages section – TwilCynder Jan 04 '22 at 17:15
  • Can't you use e.g. `[states.md](md_states.html)`? – albert Jan 04 '22 at 17:39
  • 1
    Small complicating factor is the dub directories you use. Looks like: `[states.md](md_doc_files_states.html)` and `[states.md](states.md)` work. – albert Jan 04 '22 at 17:55
  • Oh yeah, didn't think about that. `[states.md](states.md)` links to the empty page, but ` [states.md](md_doc_files_states.html)` works just fine? Thanks ! – TwilCynder Jan 04 '22 at 22:30

1 Answers1

0

You can add an anchor in the headline of markdown and link it directly. This is more clean then linking to the created html file. See official doc.

Here is an examlple:

doit.md:

# Specific Information on doIt() {#doit_specific}

- First do this
- Then that
- And finish up

Then you can link it in your doxygen. e.g. doIt.h:

//! Does it
//!
//! See \ref doit_specific "specific information".
//!
void doIt();

Note: You can also just \ref doit_specific and it will use the headline as the text.

Additional info: Make sure, the markdown page appears in the related page sections. If it does not, you need to edit the doxygen settings. See https://stackoverflow.com/a/9522667/4675668

kuga
  • 1,483
  • 1
  • 17
  • 38