coffeedoc / codo

CoffeeScript API documentation generator. It's like YARD but for CoffeeScript!
Other
625 stars 92 forks source link

Annotation for class properties #172

Closed fntz closed 10 years ago

fntz commented 10 years ago

How to annotate class properties?

class MyClass
   # @property [Boolean] - my property
   @prop: true 

By now, it's not works.

ahamid commented 10 years ago

i noticed this as well, it appears to treat all @var as variable in Variables Summary. I'm not sure if it's a bug because it displays the variable value which I find convenient.

I have to use block comments for it to be detected:

class MyClass:
  ###
  a class property
  ###
  @someprop:
    content: will
    appear: in
    variables: summary
inossidabile commented 10 years ago

It really is a little bit of logical inconsistency. Codo treats class-level entries as class variables and instance-level entities as nothing unless they are specified as properties. We should however be able to allow specifying class-level properties and give it priority. I'll try to fix this shortly.

P.S. You shouldn't have to use block-level comments to list them (there's a spec to confirm that). If you are confident there's a case where Codo can't properly detect class-level please report it separately with an example.

fntz commented 10 years ago

thanks