appledoc icon indicating copy to clipboard operation
appledoc copied to clipboard

@bug and @warning formatting engulfs subsequent paragraphs

Open clozach opened this issue 14 years ago • 13 comments

The code below results in a blue warning block that encapsulates both commented lines. If I change @warning to @bug, the block turns yellow, but still encompasses both lines, rather than just the first one.

/**

@warning Testing. Inside warning paragraph.

This should fall outside warning style.

*/

@interface MyAppDelegate : NSObject <UIApplicationDelegate> {
...

clozach avatar May 25 '11 05:05 clozach

This is actually appledoc feature: this way you can have multiple paragraphs inside a box, which is what Apple does sometimes. My usage is to put @warning or @bug at the end of the description, just above method directives (@param, @return etc.). But if you want to have box in between description paragraphs, then some end-of-block marker should be added. As non obtrusive and Markdown-like as possible... I'll leave this issue opened for suggestions for a while to gather different ideas...

tomaz avatar May 25 '11 06:05 tomaz

The most MD-like way IMO would be to close it with another @warning.

karlwa avatar Jan 08 '12 07:01 karlwa

That's how it works now.

tomaz avatar Jan 12 '12 10:01 tomaz

I tried to use the warning inside a -template document included with --include, and got the same behaviour as reported here.

The problem is, in a code comment it makes sense to place the @warning last, but not necessarily in a code companion document. In that case, it might even make more sense to place the warning at the top - right after the page title, for instance.

I have tried to close it with another @warning, but it does not get recognized.

smono avatar Apr 21 '12 11:04 smono

I agree it's not ideal, although didn't find good solution to have it work both ways and decide on case by case. This would require some syntax outside Markdown default. I'm currently focusing on updating the code to make it more maintainable. Perhaps an idea will pop in between. I'm also open for any suggestions.

tomaz avatar Apr 21 '12 15:04 tomaz

Adding another @discussion for the second line (desired to be outside the @warning block) worked for me.

jeffla avatar Sep 27 '13 16:09 jeffla

What should be done when wanting to include @warning's inside a -template document (included with --include)?

ghost avatar Oct 09 '13 09:10 ghost

It should just work (I think :), the same way as in code comments.

tomaz avatar Oct 09 '13 10:10 tomaz

Using @bug or @warning consumes the rest of the document, I can't figure out how to end it? I've tried doing:

@warning test
@warning

And that doesn't appear to work either.

ghost avatar Oct 09 '13 10:10 ghost

That's correct - it's so that you can include multiple paragraphs, lists etc. You can only end it with another @bug or @warning. So for the moment being use them at the bottom of the document.

tomaz avatar Oct 09 '13 11:10 tomaz

@ChristopherLord I'm getting around this issue this way in readme.markdown:

@warning Insert warning text here

@discussion Continue here

Obbut avatar Jan 21 '14 14:01 Obbut

This also has the annoying side effect that if you @warning in the comment of a class declaration and have additional comments on a category for that same class, when the category comments are pulled into the documentation for the class they will be placed in the @warning section. I don't believe that can be argued as a feature.

/**
 @warning Some warning
*/
@interface Foo
@end

/**
  Some plain comments
*/
@interface Foo (SomeCategory)
@end

Some plain comments will be under the @warning in the output documentation

NSProgrammer avatar Aug 28 '14 23:08 NSProgrammer

This is definitely not a feature :)

tomaz avatar Aug 29 '14 07:08 tomaz