sassdoc icon indicating copy to clipboard operation
sassdoc copied to clipboard

Add ability to use --debug with Gulp

Open KittyGiraudel opened this issue 9 years ago • 8 comments

In a Gulp setup, debug: true does not print anything.

gulp.task('sassdoc', function () {
  return gulp
    .src('./**/*.scss')
    .pipe(sassdoc({
      dest: './views/sassdoc',
      config: './.sassdocrc', 
      debug: true,
      verbose: true
    }))
    .resume();
});
[15:39:43] Starting 'sassdoc'...
[15:39:43] Finished 'sassdoc' after 164 ms
» [WARNING] Parser for annotation `flag` not found. Location: `linePoster.test.scss:5:8`
» Sass sources successfully parsed.
» Folder `views/sassdoc` successfully refreshed.
» Theme `default` successfully rendered.
» Process over. Everything okay!
✓ SassDoc completed after 164ms

KittyGiraudel avatar May 29 '15 13:05 KittyGiraudel

--debug is indeed a CLI option, but not a configuration option.

However you can always set the SASSDOC_DEBUG environment variable to enable debugging from anywhere:

SASSDOC_DEBUG=1 gulp sassdoc

valeriangalliat avatar May 29 '15 13:05 valeriangalliat

So I'm not sure how to deal with this issue. It's not a bug, and everything works like documented, so we could close, but maybe adding a debug option is desirable?

valeriangalliat avatar May 29 '15 13:05 valeriangalliat

Perhaps yep.

KittyGiraudel avatar May 29 '15 14:05 KittyGiraudel

Technically this is more a new feature, but we must wait 2.2 to release it if we consider it as so. If we see this as a bug, I can release the debug option right away in a patch. What do you think?

(I have code ready.)

valeriangalliat avatar May 29 '15 16:05 valeriangalliat

@SassDoc/owners?

KittyGiraudel avatar May 29 '15 16:05 KittyGiraudel

It feels like that something users might want, and would be more familiar with: passing the option into the gulp/grunt/... task rather than from the command line. Semantically yes, we should wait for 2.2 ^^

pascalduez avatar May 29 '15 18:05 pascalduez

@valeriangalliat how would that work with the JSON file dumping ? Maybe not needed ?

Might be a good idea to move all the debug logic into its own file and just call methods. Similar to the debug package.

pascalduez avatar May 29 '15 18:05 pascalduez

@pascalduez It would dump a sassdoc-data.json in the CWD, as usual. I think it's as useful in plugins as in CLI.

I don't get what you mean with the debug logic... the debug function is already in logger.js, and we use it like the debug package if I'm right?

valeriangalliat avatar May 29 '15 18:05 valeriangalliat