4

A lot of the new documentation commands for XCode has been discussed here, but even with the commands explained there, I can't seem to find a way to make a command span multiple words.

Let me give an example:

Input: Hi, I am for @a cosmetic purposes only.

Output: Hi, I am for cosmetic purposes only.

Nothing wrong there, but imagine me wanting to make the word purposes italic as well. There the problem starts. I tried:

Input: Hi, I am for @a cosmetic @a purposes only.

Output: Hi, I am for cosmeticpurposes only.

--

Input: Hi, I am for @a cosmetic <any amount of spaces> @a purposes only.

Output: Hi, I am for cosmeticpurposes only.

--

Input: Hi, I am for @a cosmetic @a @a purposes only.

Output: Hi, I am for cosmeticpurposes only.

--

Input: Hi, I am for @a cosmetic @a @a @a purposes only.

Output: Hi, I am for cosmeticpurposes only.

--

Input: Hi, I am for @a cosmetic <line break> @a purposes only.

Output: Hi, I am for cosmeticpurposes only.

--

As you can see, I can't seem to find a way to do it. Somehow all whitespaces seem to get trimmed. Does anyone knows a solution to this one?

2 Answers 2

4

I'm not sure if you already knew this or not but the following works for XCode 6:

Italic:

Hi, I am for <em>cosmetic purposes</em> only.

Bold:

Hi I am for <b>cosmetic purposes</b> only.

I am currently looking for a solution to @c, couldn't find one yet.

Edit: Oh well, <code>...</code> works for @c.

Sign up to request clarification or add additional context in comments.

4 Comments

By the way, try out HTML tags, most of them works! You might be surprised with <li>, <pre> etc.
Yeah, I just tried a lot of HTML..indeed surprising how that just works. Makes documenting your code that much better!
<a></a> works in the way that if underlines and colours it like a link but it doesn't open the url :(. Maybe could someone tweak it to make it work, or even better, to redirect to another method like Apple own documentation does.
I guess you can make it work using a href attribute but you need to generate a docset to be able to follow links as you do in Apple's docs.
0
+50

You can put space in following way:

/*! Sample @a italic &#x200B; @a comment  */

just putting blank space code in between two tags

6 Comments

This still doesn't make the code span multiple words but, it is a nice workaround though. Until there is some way to really solve it, I'll use it.
you can try other special character code too :sagehill.net/docbookxsl/SpecialChars.html, many of them may work for you
Thanks, I was aware of the usage of character codes in the documentation. But I was hoping for a 'true' way to make a span in documentation (i.e. the <span> tag in HTML).
I dont think there may be such things available for documentation, still not sure
Will tell you if i get it anywhere
|

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.