SassDoc / sassdoc

Release the docs!
http://sassdoc.com
MIT License
1.41k stars 56 forks source link

Can't get "parameter" annotation to work without error #427

Closed smlombardi closed 8 years ago

smlombardi commented 8 years ago

The documentation for "Parameter" reads:

/// @param {type} $name
/// @param {type | othertype} $name
/// @param {type} $name - description
/// @param {type} $name [default value] - description

But I must not get it, since this throws a Gulp error: [WARNING] Annotation parameter is not allowed on comment from type unknown in _mixins.scss:184:184.

/// HiDPI mixin. Default value set to 1.3 to target Google Nexus 7 (http://bjango.com/articles/min-device-pixel-ratio/)
@mixin hidpi($ratio: 1.3) {
  @media only screen and (-webkit-min-device-pixel-ratio: $ratio),
  only screen and (min--moz-device-pixel-ratio: $ratio),
  only screen and (-o-min-device-pixel-ratio: #{$ratio}/1),
  only screen and (min-resolution: round($ratio * 96dpi)),
  only screen and (min-resolution: $ratio * 1dppx) {
    @content;
  }
}
/// @param number $ratio
/// @example scss - Usage
// @include hidpi(1.5) {
//   --stuff
// }```
pascalduez commented 8 years ago

Hi,

all your SassDoc comments and annotations needs to be grouped above the documented item. Like in the documentation. You can't split them as you did.

smlombardi commented 8 years ago

Can you please include a sample of how the annotations are used? I put them all above, no more error but no params output either.

@param {type} $name [default value] - description is only partly helpful; can you supply a sample is a use context?

For example, the Neat docs have params like

screen shot 2015-10-06 at 12 56 03 pm

What would be the corresponding sassdoc code used to generate this?

On Tue, Oct 6, 2015 at 10:54 AM, Pascal Duez notifications@github.com wrote:

Hi,

all your doc comments and annotations needs to be grouped above the documented item. You can't split them as you did.

— Reply to this email directly or view it on GitHub https://github.com/SassDoc/sassdoc/issues/427#issuecomment-145883084.

pascalduez commented 8 years ago

The neat code can be browsed here: https://github.com/thoughtbot/neat/blob/master/app/assets/stylesheets/

As for your first example:

/// HiDPI mixin. Default value set to 1.3 to target Google Nexus 7
/// @param {Number} $ratio [1.3] - A description
/// @example scss - Usage
///   @include hidpi(1.5) {
///      color: blue;
///    }
@mixin hidpi($ratio: 1.3) {
  ...
}

TIP 1: the indentation for the example is mandatory, since the example snippet is starting with an @. TIP 2: You can play/test your comments online with http://sassdoc.com/sassdocmeister

smlombardi commented 8 years ago

Many thanks. I love sassdoc, excellent work.

On Tuesday, October 6, 2015, Pascal Duez notifications@github.com wrote:

The neat code can be browsed here: https://github.com/thoughtbot/neat/blob/master/app/assets/stylesheets/

As for your first example:

/// HiDPI mixin. Default value set to 1.3 to target Google Nexus 7/// @param {Number} $ratio [1.3] - A description/// @example scss - Usage/// @include hidpi(1.5) {/// color: blue;/// }@mixin hidpi($ratio: 1.3) { ... }

TIP 1: the indentation for the example is mandatory, since the example snippet is starting with an @. TIP 2: You can play/test your comments online with http://sassdoc.com/sassdocmeister

— Reply to this email directly or view it on GitHub https://github.com/SassDoc/sassdoc/issues/427#issuecomment-145970649.