Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

libsass does not accept parsing from stdin #55

Closed
mingodad opened this Issue Oct 22, 2012 · 6 comments

Comments

Projects
None yet
4 participants

Testing sassc I noticed that it doesn't accept input from stdin and looking to implement that I found that libsass doesn't accept input from stdin because it tries to fstat a file name to get it's size and preallocate memory to ready it all in memory.

Would be nice if we could use sassc/libsass accepts input from stdin that way it could be part of a sequence of filters through redirection.

cat some.scss | sed | sassc | sed | ...

Given the way that the LibSass tokenizer is implemented, LibSass itself will probably not be able to stream from stdin. It would be better for the caller/wrapper to read everything from stdin and pass it to LibSass as a string. I'll close this ticket and open a corresponding one in the SassC repo.

@akhleung akhleung closed this Nov 29, 2012

Hi,
Any news on this feature ?

Owner

hcatlin commented Oct 16, 2014

@franckbret LibSass is a pure library. It doesn't execute itself. SassC is the counterpart to libsass that allows you to read from stdin.

Thanks for your answer. Btwi don't get why i can't see this option when I run ./bin/sassc --help

I've seen this merge, quite old but with stdin support at the sassc level, so I supposed it was ok... sass/sassc#44

Now I really miss something...

Looks like I run sassc version 0.4.2

./bin/sassc --version
sassc 0.4.2

./bin/sassc --help
Usage: sassc [options] SCSS_FILE [OUT_CSS_FILE]

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -s STYLE, --output-style=STYLE
                    Coding style of the compiled result.  Choose one of
                    compact, expanded, compressed, or nested. [default:
                    nested]
   -m, -g, --sourcemap   Emit source map.  Requires the second argument (output
                    css filename).
   -I DIR, --include-path=DIR
                    Path to find "@import"ed (S)CSS source files.  Can be
                    multiply used.
   -i DIR, --image-path=DIR
                    Path to find images. [default: ./]
   -w, --watch           Watch file for changes.  Requires the second argument
                    (output css filename).

Obviously if i give something from stdin or if I use --stdin arg, it fails. Why do ./bin/sassc doesn't give the same options as I can see there ? https://github.com/sass/sassc/blob/master/sassc.c

Thanks in advance

Owner

hcatlin commented Oct 16, 2014

Can you please open an issue on SassC? This isn’t something we can fix in this project.

On Thu, Oct 16, 2014 at 10:21 AM, franck bret notifications@github.com
wrote:

Thanks for your answer. Btwi don't get why i can't see this option when I run ./bin/sassc --help
I've seen this merge, quite old but with stdin support at the sassc level, so I supposed it was ok... sass/sassc#44
Now I really miss something...
Looks like I run sassc version 0.4.2
./bin/sassc --version
sassc 0.4.2
./bin/sassc --help
Usage: sassc [options] SCSS_FILE [OUT_CSS_FILE]
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-s STYLE, --output-style=STYLE
Coding style of the compiled result. Choose one of
compact, expanded, compressed, or nested. [default:
nested]
-m, -g, --sourcemap Emit source map. Requires the second argument (output
css filename).
-I DIR, --include-path=DIR
Path to find "@import"ed (S)CSS source files. Can be
multiply used.
-i DIR, --image-path=DIR
Path to find images. [default: ./]
-w, --watch Watch file for changes. Requires the second argument
(output css filename).
Obviously if i give something from stdin or if I use --stdin arg, it fails. Why do ./bin/sassc doesn't give the same options as I can see there ? https://github.com/sass/sassc/blob/master/sassc.c

Thanks in advance

Reply to this email directly or view it on GitHub:
#55 (comment)

Sure, thanks for your response.
sass/sassc#76

@anlutro anlutro pushed a commit to alprs/libsass that referenced this issue Feb 2, 2015

@hcatlin hcatlin Merge pull request #55 from xzyfer/feat/list-separator
Re-add specs for list_separator
bb26167
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment