Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Document how to compile Sass syntax from a string. #77

@dan-passaro

Description

@dan-passaro

Maybe I'm just slow today but I am having a tough time puzzling this out...

>>> print open('file.sass').read()
body
    font: sans-serif
    p
        font-weight: bold

>>> import sass
>>> print sass.compile(filename='file.sass')
body {
  font: sans-serif; }
  body p {
    font-weight: bold; }

>>> print sass.compile(string=open('file.sass').read())
Traceback (most recent call last):
...
CompileError: Error: invalid top-level expression
        on line 1 of stdin
>> body
   ^

What am I doing wrong? I searched the "References" part of the docs for 'SCSS' and found nothing, I can't seem to figure out how to tell sass.compile(string=...) that I want Sass syntax and not SCSS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions