如何在appledoc/HeaderDoc中缩进文档(用于有参数块的文档)

3
我创建了一个带有块作为参数的方法。该块需要一些参数,因此我想像苹果公司在具有类似格式的方法中那样缩进文档...
以下是一个简单的示例代码:
/** Loads a project from web service.
 @param securityKey The security key.
 @param block The block to execute after the web service returned all data. The block takes five arguments:
     @param data The data.
     @param fields Some fields.
*/
- (void)loadProjectWithSecurityKey:(NSString *)securityKey andCompletion:(void(^)(NSDictionary *data, NSDictionary *fields))completion;

但是很明显这只会在文档中显示如此:

enter image description here

我怎样才能让 datafields 像 Apple 那个带有参数块的方法一样缩进呢?

我在 Apple 的 HeaderDoc 文档 中没有找到如何实现这一点。


嘿,Tim,你找到怎么做了吗? - Emanuel
@Emanuel 很遗憾,我从未在Objective-C中解决过这个问题,但我发现如何在Swift中实现类似的功能。Swift的文档允许在缩进方面比Obj-C更灵活。http://nshipster.com/swift-documentation/ - timgcarlson
1个回答

2

您可以使用:

@param block My block with the following parameters: 
<table>
<tr>
  <td><tt>myParam</tt></td>
  <td>Description</td>
</tr>
</table>

至少这样在Xcode中对我来说格式合理。 - Jason Bobier
哇,不确定为什么我花了这么长时间才意识到可以用这种方式格式化。谢谢!我要尝试一下将外部生成的文档使用此方法进行格式化,看看它是否保留了格式。我认为应该会。 - timgcarlson

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接