Bring back `parse` function #318

Closed
valeriangalliat opened this Issue Jan 10, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@valeriangalliat
Member

valeriangalliat commented Jan 10, 2015

During the last stream refactoring, we dropped the parse function, which allowed the user to parse an input and directly get the data.

It's an useful feature, and we can bring it back and adapt it to the new API style. The proposed interface is:

sassdoc.parse(src, env)
  .then(console.log);

vfs.src(src)
  .pipe(sassdoc.parse(env))
  .pipe(through.obj(console.log));

And also:

sassdoc src --parse > data.json
sassdoc src -p > data.json

@valeriangalliat valeriangalliat self-assigned this Jan 10, 2015

@valeriangalliat valeriangalliat added this to the 2.0 milestone Jan 10, 2015

@FWeinb FWeinb referenced this issue Jan 10, 2015

Closed

[Meta] Development SassDoc 2.0 #255

20 of 20 tasks complete
@pascalduez

This comment has been minimized.

Show comment
Hide comment
@pascalduez

pascalduez Jan 10, 2015

Member

I guess the returned data should be a js object for API usage, and a JSON object on the CLI.

Also wondering whether the returned stream should emit data as a whole Buffer or emit it in chunks.

Member

pascalduez commented Jan 10, 2015

I guess the returned data should be a js object for API usage, and a JSON object on the CLI.

Also wondering whether the returned stream should emit data as a whole Buffer or emit it in chunks.

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
@valeriangalliat

valeriangalliat Jan 10, 2015

Member

I guess the returned data should be a js object for API usage, and a JSON object on the CLI.

Yep.

Also wondering whether the returned stream should emit data as a whole Buffer or emit it in chunks.

We can have data only as a whole because of post process. There's no reason to send it chunked.

Member

valeriangalliat commented Jan 10, 2015

I guess the returned data should be a js object for API usage, and a JSON object on the CLI.

Yep.

Also wondering whether the returned stream should emit data as a whole Buffer or emit it in chunks.

We can have data only as a whole because of post process. There's no reason to send it chunked.

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
@valeriangalliat

valeriangalliat Jan 10, 2015

Member

BTW if we output JSON to stdout, and verbose mode is on, we have to output all logs to stderr. And I think it should be the case in every mode… that is, replace console.log by console.warn for regular logs in our logger.

Member

valeriangalliat commented Jan 10, 2015

BTW if we output JSON to stdout, and verbose mode is on, we have to output all logs to stderr. And I think it should be the case in every mode… that is, replace console.log by console.warn for regular logs in our logger.

valeriangalliat added a commit to SassDoc/sassdoc.github.io that referenced this issue Jan 10, 2015

@valeriangalliat valeriangalliat referenced this issue in SassDoc/sassdoc.github.io Jan 10, 2015

Merged

Add `--parse` CLI option #86

valeriangalliat added a commit that referenced this issue Jan 10, 2015

valeriangalliat added a commit that referenced this issue Jan 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment