最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Include file with doxygen special commands - Stack Overflow

programmeradmin2浏览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

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
Share Improve this question edited Mar 18 at 9:42 albert 9,0953 gold badges22 silver badges39 bronze badges asked Mar 18 at 9:28 DgoDgo 555 bronze badges 4
  • 1 How does the \include command not do what you want to do? – Friedrich 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!)? – albert 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. – Dgo 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. – albert Commented Mar 18 at 11:31
Add a comment  | 

1 Answer 1

Reset to default 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
发布评论

评论列表(0)

  1. 暂无评论