使用 HeaderDoc 或 Doxygen 时是否可以包含代码示例?

发布于 2024-10-09 20:39:31 字数 314 浏览 0 评论 0原文

我正在用 Objective-C 编写一个 Cocoa 框架,并希望使用文档编写器来生成 API 参考。对于 .NET,很容易包含以下示例:

/// <example>
/// <code lang="c#">
/// Console.WriteLine("Hello, World!");
/// </code>
/// </example>

使用 Apple 的 HeaderDoc 工具时是否可以这样做?如果可以,将如何完成?

如果不可能,使用 Doxygen 时我该怎么做?

I am writing a Cocoa framework in Objective-C and would like to use a documentation writer to generate the API reference. For .NET, it is easy to include examples using:

/// <example>
/// <code lang="c#">
/// Console.WriteLine("Hello, World!");
/// </code>
/// </example>

Is this possible when using Apple's HeaderDoc tool, and if so, how would it be done?

If it is not possible, how would I do it when using Doxygen?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无语# 2024-10-16 20:39:31

对于那些使用苹果已经安装的工具“headerdoc”的人来说,它看起来像这样:

/*!
   <pre>
   @textblock
   - (void)foo {
      // bar
   }
   @/textblock
   </pre>
*/

For those who go with Apples already installed tool "headerdoc", it can look like this:

/*!
   <pre>
   @textblock
   - (void)foo {
      // bar
   }
   @/textblock
   </pre>
*/
久光 2024-10-16 20:39:31

好的 - 我已经得到答案了!我选择使用 Doxygen:

/**
 \code
 NSLog(@"Hello, World!");
 \endcode
*/

Okay - I've got the answers! I've chosen to go with Doxygen:

/**
 \code
 NSLog(@"Hello, World!");
 \endcode
*/
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文