Skip to content

Add ability to pipe SassDoc into stdin - #315

Merged
pascalduez merged 4 commits into
developfrom
stdin-support
Jan 9, 2015
Merged

Add ability to pipe SassDoc into stdin#315
pascalduez merged 4 commits into
developfrom
stdin-support

Conversation

@pascalduez

Copy link
Copy Markdown
Member

Introduce a new -s --stdin flag to make it clear/intentional ?

Example:
cat test/data/test.scss | bin/sassdoc -vs

@valeriangalliat

Copy link
Copy Markdown
Member

Awesome!

I would rather remove the --stdin option and use stdin when src is not given. I think it's intentional enough, I don't see a case where you unintentionally ommit the source directory, you at least know you want to documentize something.

@FWeinb

FWeinb commented Jan 9, 2015

Copy link
Copy Markdown
Member

Like @valeriangalliat said. We can assume that the omission of <src> is a clear sign for wanting to read from stdin.

@pascalduez

Copy link
Copy Markdown
Member Author

Okay for removing --stdin but I'm currently trying to push things even further with stdout.

No Gulp pipeline:

cat file.scss | bin/sassdoc -s | sass -s --scss --sourcemap=none test.css

@valeriangalliat

Copy link
Copy Markdown
Member

It's interesting, but I really don't believe it's a "normal" use case. It makes no sense to me to both documentize and compile SCSS in the same pipeline, and it gives the impression that SassDoc is filtering the stream, which is not the case.

Additionnally it don't allows parallel running, while defining this with, for example, two distinct makefile tasks could be parallelized.

@pascalduez

Copy link
Copy Markdown
Member Author

If I'm not mistaken, it's similar to:

var gulp = require('gulp');
var sass = require('gulp-sass');
var sassdoc = require('sassdoc');

gulp.task('styles', function () {
  return gulp.src('./file.scss')
    .pipe(sassdoc({ verbose: true }))
    .pipe(sass());
});

It should also be able to:

sassdoc src | sass -s --scss --sourcemap=none src

@valeriangalliat

Copy link
Copy Markdown
Member

Yep. I don't use Gulp so I don't know if it makes sense, but for sure it looks odd in a shell pipeline.

@pascalduez

Copy link
Copy Markdown
Member Author

Not 100% sure it makes sense, but that was one of the goal to the whole stream refactor, being able to pipe SassDoc in a Gulp pipeline, without requiring a dedicated task. That's why we pass trough the files also.

@FWeinb

FWeinb commented Jan 9, 2015

Copy link
Copy Markdown
Member

@pascalduez and @valeriangalliat you are both right. In the context of gulp this is perfect but behaviour like this isn't expected on the shell pipe. Nevertheless it is not that bad to have it.

@pascalduez

Copy link
Copy Markdown
Member Author

Okay guys, no stdout !!

@valeriangalliat

Copy link
Copy Markdown
Member

Right, all good there then?

pascalduez added a commit that referenced this pull request Jan 9, 2015
Add ability to pipe SassDoc into `stdin`
@pascalduez
pascalduez merged commit 764c799 into develop Jan 9, 2015
@pascalduez
pascalduez deleted the stdin-support branch January 9, 2015 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants