0

Does doxygen have a special command to include a file into a source file and doxygen treats the included file as if it were directly in the source file?

Both variants shall generate the same output. It's not just about replacing @details, but a large amount of text.

Variant A

// --- SourceFile.c ---
/*! \brief description 
 *  \details description
 */

Variant B

// --- SourceFile.c ---
/*! \brief description 
 *  \command file.txt -> this shall insert file.txt here
 */

// --- file.txt ---
// \details description
4
  • 1
    How does the \include command not do what you want to do? Commented Mar 18 at 9:35
  • 1
    Besides the correct remark from @Friedrich also have a look st the possible options with the \include command and at the \snippet command with its options. Furthermore which version of doxygen are you using (very important in this case!)? Commented Mar 18 at 9:42
  • I am using doxygen 1.8.20. In this version doxygen special commands does not work inside \include. But I see there is an option in a newer version. Seems to be time for an update. Commented Mar 18 at 11:03
  • 1
    Doxygen 1.8.20 is already a bit older (August 24, 2020) the current version of doxygen is 1.13.2 In between quite a few improvements have been made also in respect to the \include and \snippet commands. I certainly do advise to update. Commented Mar 18 at 11:31

1 Answer 1

0

In newer versions of doxygen the \include special command has an additional option. With the option {doc} the contents of file.txt is treated as if it were directly in the source file.

// --- SourceFile.c ---
/*! \brief description 
 *  \include{doc} file.txt
 */

// --- file.txt ---
// \details description
Sign up to request clarification or add additional context in comments.

1 Comment

The doxygen 1.8.20 had already the \includedoc command (introduced in doxygen 1.8.12),. It looks like the option doc with the include command was introduced in doxygen 1.8.14 In the newer versions of doxygen the handling of the \includedoc / \include{doc} (which are identical commands!) has greatly improved though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.