sassdoc icon indicating copy to clipboard operation
sassdoc copied to clipboard

Change behavior when no `src`

Open valeriangalliat opened this issue 10 years ago • 11 comments
trafficstars

Currently sassdoc executed as-is will try to read from stdin for SCSS input (that is, meant to be used like cat file | ... | sassdoc.

Though I don't expect this to be a common use and we might better default to documenting the CWD when SassDoc is executed without any src.

The - is a standard convention to mean stdin/stdout in Unix commands: http://tldp.org/LDP/abs/html/special-chars.html#DASHREF2

valeriangalliat avatar Jan 29 '15 10:01 valeriangalliat

Seconded.

KittyGiraudel avatar Jan 29 '15 10:01 KittyGiraudel

Like it.

pascalduez avatar Jan 29 '15 11:01 pascalduez

Oh! If we default to ./, we can't put the documentation in sassdoc.

valeriangalliat avatar Jan 29 '15 13:01 valeriangalliat

Why?

KittyGiraudel avatar Jan 29 '15 13:01 KittyGiraudel

Because it will document theme stylesheets with project stylesheets… and it feels odd dest is contained in src, even if it should not be prohibited by safe-wipe.

valeriangalliat avatar Jan 29 '15 13:01 valeriangalliat

C-style comments don't exist anymore. Project stylesheets won't contain any SassDoc comment.

KittyGiraudel avatar Jan 29 '15 13:01 KittyGiraudel

Oh right, it's okay if sassdoc directroy don't contains SassDoc comments, then.

Though we might need some sort of default excludes, we don't want to documentize files under node_modules or any other vendor directory…

valeriangalliat avatar Jan 29 '15 13:01 valeriangalliat

Agreed.

KittyGiraudel avatar Jan 29 '15 13:01 KittyGiraudel

This can't be merged for the today 2.0 release for sure. The problem is the current behavior is to read from stdin when no <src> is given. It will be a breaking change if we want to fallback to current directory later, and we'll need to wait 3.0 for this.

It's possible to drop the current "stdin by default" behavior before releasing 2.0, and require at least one <src>, so we're free to include whatever default behavior we want later on.

Opinions on this @SassDoc/owners? We need to take an action on this before releasing 2.0.

valeriangalliat avatar Jan 30 '15 09:01 valeriangalliat

I suppose we can also consider dropping the idea of not passing src to default to ./. It was just a suggestion, I'm not sure it's a big deal in any way.

KittyGiraudel avatar Jan 30 '15 13:01 KittyGiraudel

The dash for stdin was merged (#350), so we can choose whatever we want for default behavior subsequently.

There's a WIP PR to use ./ by default in #351. We'll see later how to improve this.

valeriangalliat avatar Jan 30 '15 13:01 valeriangalliat