I usually need to write many short code in code comment like this
. Is this possible to use in Apple's Headerdoc? Because this type of code notation is generally used heavily, so i believe there's a convenient way to do this instead of marking HTML tags.
How to mark code snippet in Headerdoc?
Asked Answered
I ended up with using @c
.
This is an example @c code-style text.
You need to format a block of code use: @code
&@endcode
tags like:
/**
* @code
* [myObj myMethod];
* @endcode
*/
If you want to format a single word @c
is enough, like:
/**
* @c is enough
*/
Within your HeaderDoc, you can use this formatting:
@code
// code text
while (someCondition) {
NSLog(@"Hello");
doSomething();
}@endcode
Last line text.
Source: https://mcmap.net/q/127890/-what-are-the-new-documentation-commands-available-in-xcode-5-closed
I ended up with using @c
.
This is an example @c code-style text.
@code
and @c
don't seem to work as of Headerdoc 8.9.
I ended up using:
<pre>@textblock
@/textblock</pre>
For whom seeking for the right answer. This your answer. –
Sharl
I'm on Xcode 6.4/HeaderDoc 8.9 and neither @code
nor @c
work. <pre>code</pre>
works but adds newlines.
I ended up being able to produce inline code snippets by using <tt>code</tt>
(teletype text).
© 2022 - 2024 — McMap. All rights reserved.
Unknown field type @code in HeaderDoc comment.
– Banville