mkluwe
mkluwe

Reputation: 4061

referencing markdown mainpage content with doxygen 1.8.3

I'm using a markdown mainpage (mainpage.md) like this

The Main Page
=============

qwertz

A Section
---------

asdf

together with USE_MDFILE_AS_MAINPAGE = mainpage.md in the configuration.

I'd like to (auto-)link to the section 'A Section' from the documentation in the source coude, but I haven't yet figured out how to do that. I assume the 'A Section' generates an auto-linkable target, but how do I reference that (i.e. using \see ?WhatToWriteHere?)?

Additionaly, trying this

A Section {#asdfg}
---------

yields the strange warning found subsection command outside of section context!.

Upvotes: 1

Views: 1025

Answers (1)

Cheeseminer
Cheeseminer

Reputation: 3078

If you code the mainpage using @section section_01 A Section instead of using the ===== underlines then you can use the doxygen command

@ref section_01 "text for link here"

to create a link to it from elsewhere. I'm doing this successfully using 1.8.5.

It seems that vanilla markdown headers (either using underlining of # sequences) processed by Doxygen don't produce anything that Doxygen recognises as a target - either for linking to or for listing in a document index (which is a bit frustrating).

Upvotes: 1

Related Questions