sassc 1.8.0.pre2 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -2
- data/ext/libsass/contrib/plugin.cpp +4 -1
- data/ext/libsass/docs/README.md +20 -0
- data/ext/libsass/docs/api-context-example.md +45 -0
- data/ext/libsass/docs/api-context-internal.md +152 -0
- data/ext/libsass/docs/api-context.md +268 -0
- data/ext/libsass/docs/api-doc.md +160 -0
- data/ext/libsass/docs/api-function-example.md +58 -0
- data/ext/libsass/docs/api-function-internal.md +8 -0
- data/ext/libsass/docs/api-function.md +48 -0
- data/ext/libsass/docs/api-importer-example.md +1345 -0
- data/ext/libsass/docs/api-importer-internal.md +15 -0
- data/ext/libsass/docs/api-importer.md +84 -0
- data/ext/libsass/docs/api-value-example.md +0 -0
- data/ext/libsass/docs/api-value-internal.md +76 -0
- data/ext/libsass/docs/api-value.md +125 -0
- data/ext/libsass/docs/build-on-darwin.md +27 -0
- data/ext/libsass/docs/build-on-gentoo.md +55 -0
- data/ext/libsass/docs/build-on-windows.md +139 -0
- data/ext/libsass/docs/build-shared-library.md +35 -0
- data/ext/libsass/docs/build-with-autotools.md +68 -0
- data/ext/libsass/docs/build-with-makefiles.md +50 -0
- data/ext/libsass/docs/build-with-mingw.md +107 -0
- data/ext/libsass/docs/build-with-visual-studio.md +90 -0
- data/ext/libsass/docs/build.md +97 -0
- data/ext/libsass/docs/compatibility-plan.md +48 -0
- data/ext/libsass/docs/contributing.md +17 -0
- data/ext/libsass/docs/custom-functions-internal.md +120 -0
- data/ext/libsass/docs/implementations.md +49 -0
- data/ext/libsass/docs/plugins.go +47 -0
- data/ext/libsass/docs/setup-environment.md +68 -0
- data/ext/libsass/docs/source-map-internals.md +51 -0
- data/ext/libsass/docs/trace.md +26 -0
- data/ext/libsass/docs/triage.md +17 -0
- data/ext/libsass/docs/unicode.md +39 -0
- data/ext/libsass/include/sass/context.h +1 -0
- data/ext/libsass/include/sass/functions.h +1 -1
- data/ext/libsass/src/ast.cpp +12 -2
- data/ext/libsass/src/ast.hpp +10 -2
- data/ext/libsass/src/bind.cpp +0 -2
- data/ext/libsass/src/debug.hpp +4 -0
- data/ext/libsass/src/debugger.hpp +2 -1
- data/ext/libsass/src/emitter.cpp +2 -0
- data/ext/libsass/src/eval.cpp +5 -7
- data/ext/libsass/src/expand.cpp +8 -1
- data/ext/libsass/src/functions.cpp +19 -4
- data/ext/libsass/src/inspect.cpp +17 -0
- data/ext/libsass/src/json.cpp +1 -1
- data/ext/libsass/src/parser.cpp +10 -1
- data/ext/libsass/src/prelexer.cpp +1 -1
- data/ext/libsass/src/sass_context.cpp +1 -0
- data/ext/libsass/src/sass_values.cpp +1 -1
- data/lib/sassc/version.rb +1 -1
- data/test/native_test.rb +1 -1
- metadata +37 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f13097a5a3ad307a313cbe5e042460b96cc56d02
|
4
|
+
data.tar.gz: 5ebc6f97d3066bfecd7c8334a2e1b1b6d51e90d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de32bd0766e935adce472e86769b7a8c71aae7e5ed81af6a810d8cd3dcbc08df44b2e4db4e8bca01e45a179a4f203f0c0fa7622e5dab307d36e1fcd21606a130
|
7
|
+
data.tar.gz: fbc161e22ee1159e5b118687199bc6289b0b8eb1e981e807eb576e4ce1d571cf4f39751d6cb3be0cc02652272e192c87434ac21f19f7cd515b37b9b89b379f1b
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ This gem combines the speed of `libsass`, the [Sass C implementation](https://gi
|
|
6
6
|
|
7
7
|
### libsass Version
|
8
8
|
|
9
|
-
[3.3.0
|
9
|
+
[3.3.0](https://github.com/sass/libsass/releases/tag/3.3.0)
|
10
10
|
|
11
11
|
## Usage
|
12
12
|
|
@@ -25,7 +25,11 @@ and [awesome contributors](https://github.com/bolandrm/sassc-ruby/graphs/contrib
|
|
25
25
|
|
26
26
|
## Changelog
|
27
27
|
|
28
|
-
- **1.8.0
|
28
|
+
- **1.8.0**
|
29
|
+
- Update to Libsass 3.3.0
|
30
|
+
- **1.8.0.pre2**
|
31
|
+
- Fix bug with looking up gem_path
|
32
|
+
- **1.8.0.pre1**
|
29
33
|
- [Update to Libsass 3.3.0-beta3](https://github.com/sass/sassc-ruby/pull/20)
|
30
34
|
- **1.7.1**
|
31
35
|
- Some updates to `Engine` API.
|
@@ -10,8 +10,11 @@ extern "C" const char* ADDCALL libsass_get_version() {
|
|
10
10
|
return libsass_version();
|
11
11
|
}
|
12
12
|
|
13
|
-
union Sass_Value* custom_function(const union Sass_Value* s_args, Sass_Function_Entry cb, struct
|
13
|
+
union Sass_Value* custom_function(const union Sass_Value* s_args, Sass_Function_Entry cb, struct Sass_Compiler* comp)
|
14
14
|
{
|
15
|
+
// get context/option struct associated with this compiler
|
16
|
+
struct Sass_Context* ctx = sass_compiler_get_context(comp);
|
17
|
+
struct Sass_Options* opts = sass_compiler_get_options(comp);
|
15
18
|
// get the cookie from function descriptor
|
16
19
|
void* cookie = sass_function_get_cookie(cb);
|
17
20
|
// we actually abuse the void* to store an "int"
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Welcome to the LibSass wiki!
|
2
|
+
|
3
|
+
## First Off
|
4
|
+
LibSass is just a library. To run the code locally (i.e. to compile your stylesheets), you need an implementer. SassC (get it?) is an implementer written in C. There are a number of other implementations of LibSass - for example Node. We encourage you to write your own port - the whole point of LibSass is that we want to bring Sass to many other languages, not just Ruby!
|
5
|
+
|
6
|
+
We're working hard on moving to full parity with Ruby Sass... learn more at the [The-LibSass-Compatibility-Plan](compatibility-plan.md)!
|
7
|
+
|
8
|
+
### Implementing LibSass
|
9
|
+
|
10
|
+
If you're interested in implementing LibSass in your own project see the [API Documentation](api-doc.md) which now includes implementing
|
11
|
+
your own [Sass functions](api-function.md). You may wish to [look at other implementations](implementations.md) for your language of choice.
|
12
|
+
Or make your own!
|
13
|
+
|
14
|
+
### Contributing to LibSass
|
15
|
+
|
16
|
+
| Issue Tracker | Issue Triage | Community Guidelines |
|
17
|
+
|-------------------|----------------------------------|-----------------------------|
|
18
|
+
| We're always needing help, so check out our issue tracker, help some people out, and read our article on [Contributing](contributing.md)! It's got all the details on what to do! | To help understand the process of triaging bugs, have a look at our [Issue-Triage](triage.md) document. | Oh, and don't forget we always follow [[Sass Community Guidelines|http://sass-lang.com/community-guidelines]]. Be nice and everyone else will be nice too! |
|
19
|
+
|
20
|
+
Please refer to the steps on [Building LibSass](build.md)
|
@@ -0,0 +1,45 @@
|
|
1
|
+
## Example main.c
|
2
|
+
|
3
|
+
```C
|
4
|
+
#include <stdio.h>
|
5
|
+
#include "sass_context.h"
|
6
|
+
|
7
|
+
int main( int argc, const char* argv[] )
|
8
|
+
{
|
9
|
+
|
10
|
+
// get the input file from first argument or use default
|
11
|
+
const char* input = argc > 1 ? argv[1] : "styles.scss";
|
12
|
+
|
13
|
+
// create the file context and get all related structs
|
14
|
+
struct Sass_File_Context* file_ctx = sass_make_file_context(input);
|
15
|
+
struct Sass_Context* ctx = sass_file_context_get_context(file_ctx);
|
16
|
+
struct Sass_Options* ctx_opt = sass_context_get_options(ctx);
|
17
|
+
|
18
|
+
// configure some options ...
|
19
|
+
sass_option_set_precision(ctx_opt, 10);
|
20
|
+
|
21
|
+
// context is set up, call the compile step now
|
22
|
+
int status = sass_compile_file_context(file_ctx);
|
23
|
+
|
24
|
+
// print the result or the error to the stdout
|
25
|
+
if (status == 0) puts(sass_context_get_output_string(ctx));
|
26
|
+
else puts(sass_context_get_error_message(ctx));
|
27
|
+
|
28
|
+
// release allocated memory
|
29
|
+
sass_delete_file_context(file_ctx);
|
30
|
+
|
31
|
+
// exit status
|
32
|
+
return status;
|
33
|
+
|
34
|
+
}
|
35
|
+
```
|
36
|
+
|
37
|
+
### Compile main.c
|
38
|
+
|
39
|
+
```bash
|
40
|
+
gcc -c main.c -o main.o
|
41
|
+
gcc -o sample main.o -lsass
|
42
|
+
echo "foo { margin: 21px * 2; }" > foo.scss
|
43
|
+
./sample foo.scss => "foo { margin: 42px }"
|
44
|
+
```
|
45
|
+
|
@@ -0,0 +1,152 @@
|
|
1
|
+
```C
|
2
|
+
// Input behaviours
|
3
|
+
enum Sass_Input_Style {
|
4
|
+
SASS_CONTEXT_NULL,
|
5
|
+
SASS_CONTEXT_FILE,
|
6
|
+
SASS_CONTEXT_DATA,
|
7
|
+
SASS_CONTEXT_FOLDER
|
8
|
+
};
|
9
|
+
|
10
|
+
// simple linked list
|
11
|
+
struct string_list {
|
12
|
+
string_list* next;
|
13
|
+
char* string;
|
14
|
+
};
|
15
|
+
|
16
|
+
// sass config options structure
|
17
|
+
struct Sass_Options {
|
18
|
+
|
19
|
+
// Precision for fractional numbers
|
20
|
+
int precision;
|
21
|
+
|
22
|
+
// Output style for the generated css code
|
23
|
+
// A value from above SASS_STYLE_* constants
|
24
|
+
enum Sass_Output_Style output_style;
|
25
|
+
|
26
|
+
// Emit comments in the generated CSS indicating
|
27
|
+
// the corresponding source line.
|
28
|
+
bool source_comments;
|
29
|
+
|
30
|
+
// embed sourceMappingUrl as data uri
|
31
|
+
bool source_map_embed;
|
32
|
+
|
33
|
+
// embed include contents in maps
|
34
|
+
bool source_map_contents;
|
35
|
+
|
36
|
+
// Disable sourceMappingUrl in css output
|
37
|
+
bool omit_source_map_url;
|
38
|
+
|
39
|
+
// Treat source_string as sass (as opposed to scss)
|
40
|
+
bool is_indented_syntax_src;
|
41
|
+
|
42
|
+
// The input path is used for source map
|
43
|
+
// generation. It can be used to define
|
44
|
+
// something with string compilation or to
|
45
|
+
// overload the input file path. It is
|
46
|
+
// set to "stdin" for data contexts and
|
47
|
+
// to the input file on file contexts.
|
48
|
+
char* input_path;
|
49
|
+
|
50
|
+
// The output path is used for source map
|
51
|
+
// generation. LibSass will not write to
|
52
|
+
// this file, it is just used to create
|
53
|
+
// information in source-maps etc.
|
54
|
+
char* output_path;
|
55
|
+
|
56
|
+
// String to be used for indentation
|
57
|
+
const char* indent;
|
58
|
+
// String to be used to for line feeds
|
59
|
+
const char* linefeed;
|
60
|
+
|
61
|
+
// Colon-separated list of paths
|
62
|
+
// Semicolon-separated on Windows
|
63
|
+
// Note: It may be better to use
|
64
|
+
// array interface instead
|
65
|
+
char* include_path;
|
66
|
+
char* plugin_path;
|
67
|
+
|
68
|
+
// Include paths (linked string list)
|
69
|
+
struct string_list* include_paths;
|
70
|
+
// Plugin paths (linked string list)
|
71
|
+
struct string_list* plugin_paths;
|
72
|
+
|
73
|
+
// Path to source map file
|
74
|
+
// Enables source map generation
|
75
|
+
// Used to create sourceMappingUrl
|
76
|
+
char* source_map_file;
|
77
|
+
|
78
|
+
// Directly inserted in source maps
|
79
|
+
char* source_map_root;
|
80
|
+
|
81
|
+
// Custom functions that can be called from sccs code
|
82
|
+
Sass_C_Function_List c_functions;
|
83
|
+
|
84
|
+
// Callback to overload imports
|
85
|
+
Sass_C_Import_Callback importer;
|
86
|
+
|
87
|
+
};
|
88
|
+
|
89
|
+
// base for all contexts
|
90
|
+
struct Sass_Context : Sass_Options
|
91
|
+
{
|
92
|
+
|
93
|
+
// store context type info
|
94
|
+
enum Sass_Input_Style type;
|
95
|
+
|
96
|
+
// generated output data
|
97
|
+
char* output_string;
|
98
|
+
|
99
|
+
// generated source map json
|
100
|
+
char* source_map_string;
|
101
|
+
|
102
|
+
// error status
|
103
|
+
int error_status;
|
104
|
+
char* error_json;
|
105
|
+
char* error_text;
|
106
|
+
char* error_message;
|
107
|
+
// error position
|
108
|
+
char* error_file;
|
109
|
+
size_t error_line;
|
110
|
+
size_t error_column;
|
111
|
+
|
112
|
+
// report imported files
|
113
|
+
char** included_files;
|
114
|
+
|
115
|
+
};
|
116
|
+
|
117
|
+
// struct for file compilation
|
118
|
+
struct Sass_File_Context : Sass_Context {
|
119
|
+
|
120
|
+
// no additional fields required
|
121
|
+
// input_path is already on options
|
122
|
+
|
123
|
+
};
|
124
|
+
|
125
|
+
// struct for data compilation
|
126
|
+
struct Sass_Data_Context : Sass_Context {
|
127
|
+
|
128
|
+
// provided source string
|
129
|
+
char* source_string;
|
130
|
+
|
131
|
+
};
|
132
|
+
|
133
|
+
// Compiler states
|
134
|
+
enum Sass_Compiler_State {
|
135
|
+
SASS_COMPILER_CREATED,
|
136
|
+
SASS_COMPILER_PARSED,
|
137
|
+
SASS_COMPILER_EXECUTED
|
138
|
+
};
|
139
|
+
|
140
|
+
// link c and cpp context
|
141
|
+
struct Sass_Compiler {
|
142
|
+
// progress status
|
143
|
+
Sass_Compiler_State state;
|
144
|
+
// original c context
|
145
|
+
Sass_Context* c_ctx;
|
146
|
+
// Sass::Context
|
147
|
+
void* cpp_ctx;
|
148
|
+
// Sass::Block
|
149
|
+
void* root;
|
150
|
+
};
|
151
|
+
```
|
152
|
+
|
@@ -0,0 +1,268 @@
|
|
1
|
+
Sass Contexts come in two flavors:
|
2
|
+
|
3
|
+
- `Sass_File_Context`
|
4
|
+
- `Sass_Data_Context`
|
5
|
+
|
6
|
+
### Basic Usage
|
7
|
+
|
8
|
+
```C
|
9
|
+
#include "sass_context.h"
|
10
|
+
```
|
11
|
+
|
12
|
+
***Sass_Options***
|
13
|
+
|
14
|
+
```C
|
15
|
+
// Precision for fractional numbers
|
16
|
+
int precision;
|
17
|
+
```
|
18
|
+
```C
|
19
|
+
// Output style for the generated css code
|
20
|
+
// A value from above SASS_STYLE_* constants
|
21
|
+
int output_style;
|
22
|
+
```
|
23
|
+
```C
|
24
|
+
// Emit comments in the generated CSS indicating
|
25
|
+
// the corresponding source line.
|
26
|
+
bool source_comments;
|
27
|
+
```
|
28
|
+
```C
|
29
|
+
// embed sourceMappingUrl as data uri
|
30
|
+
bool source_map_embed;
|
31
|
+
```
|
32
|
+
```C
|
33
|
+
// embed include contents in maps
|
34
|
+
bool source_map_contents;
|
35
|
+
```
|
36
|
+
```C
|
37
|
+
// Disable sourceMappingUrl in css output
|
38
|
+
bool omit_source_map_url;
|
39
|
+
```
|
40
|
+
```C
|
41
|
+
// Treat source_string as sass (as opposed to scss)
|
42
|
+
bool is_indented_syntax_src;
|
43
|
+
```
|
44
|
+
```C
|
45
|
+
// The input path is used for source map
|
46
|
+
// generating. It can be used to define
|
47
|
+
// something with string compilation or to
|
48
|
+
// overload the input file path. It is
|
49
|
+
// set to "stdin" for data contexts and
|
50
|
+
// to the input file on file contexts.
|
51
|
+
char* input_path;
|
52
|
+
```
|
53
|
+
```C
|
54
|
+
// The output path is used for source map
|
55
|
+
// generating. LibSass will not write to
|
56
|
+
// this file, it is just used to create
|
57
|
+
// information in source-maps etc.
|
58
|
+
char* output_path;
|
59
|
+
```
|
60
|
+
```C
|
61
|
+
// String to be used for indentation
|
62
|
+
const char* indent;
|
63
|
+
```
|
64
|
+
```C
|
65
|
+
// String to be used to for line feeds
|
66
|
+
const char* linefeed;
|
67
|
+
```
|
68
|
+
```C
|
69
|
+
// Colon-separated list of paths
|
70
|
+
// Semicolon-separated on Windows
|
71
|
+
char* include_path;
|
72
|
+
char* plugin_path;
|
73
|
+
```
|
74
|
+
```C
|
75
|
+
// Additional include paths
|
76
|
+
// Must be null delimited
|
77
|
+
char** include_paths;
|
78
|
+
char** plugin_paths;
|
79
|
+
```
|
80
|
+
```C
|
81
|
+
// Path to source map file
|
82
|
+
// Enables the source map generating
|
83
|
+
// Used to create sourceMappingUrl
|
84
|
+
char* source_map_file;
|
85
|
+
```
|
86
|
+
```C
|
87
|
+
// Directly inserted in source maps
|
88
|
+
char* source_map_root;
|
89
|
+
```
|
90
|
+
```C
|
91
|
+
// Custom functions that can be called from sccs code
|
92
|
+
Sass_C_Function_List c_functions;
|
93
|
+
```
|
94
|
+
```C
|
95
|
+
// Callback to overload imports
|
96
|
+
Sass_C_Import_Callback importer;
|
97
|
+
```
|
98
|
+
|
99
|
+
***Sass_Context***
|
100
|
+
|
101
|
+
```C
|
102
|
+
// store context type info
|
103
|
+
enum Sass_Input_Style type;
|
104
|
+
````
|
105
|
+
```C
|
106
|
+
// generated output data
|
107
|
+
char* output_string;
|
108
|
+
```
|
109
|
+
```C
|
110
|
+
// generated source map json
|
111
|
+
char* source_map_string;
|
112
|
+
```
|
113
|
+
```C
|
114
|
+
// error status
|
115
|
+
int error_status;
|
116
|
+
char* error_json;
|
117
|
+
char* error_text;
|
118
|
+
char* error_message;
|
119
|
+
// error position
|
120
|
+
char* error_file;
|
121
|
+
size_t error_line;
|
122
|
+
size_t error_column;
|
123
|
+
```
|
124
|
+
```C
|
125
|
+
// report imported files
|
126
|
+
char** included_files;
|
127
|
+
```
|
128
|
+
|
129
|
+
***Sass_File_Context***
|
130
|
+
|
131
|
+
```C
|
132
|
+
// no additional fields required
|
133
|
+
// input_path is already on options
|
134
|
+
```
|
135
|
+
|
136
|
+
***Sass_Data_Context***
|
137
|
+
|
138
|
+
```C
|
139
|
+
// provided source string
|
140
|
+
char* source_string;
|
141
|
+
```
|
142
|
+
|
143
|
+
### Sass Context API
|
144
|
+
|
145
|
+
```C
|
146
|
+
// Forward declaration
|
147
|
+
struct Sass_Compiler;
|
148
|
+
|
149
|
+
// Forward declaration
|
150
|
+
struct Sass_Options;
|
151
|
+
struct Sass_Context; // : Sass_Options
|
152
|
+
struct Sass_File_Context; // : Sass_Context
|
153
|
+
struct Sass_Data_Context; // : Sass_Context
|
154
|
+
|
155
|
+
// Create and initialize an option struct
|
156
|
+
struct Sass_Options* sass_make_options (void);
|
157
|
+
// Create and initialize a specific context
|
158
|
+
struct Sass_File_Context* sass_make_file_context (const char* input_path);
|
159
|
+
struct Sass_Data_Context* sass_make_data_context (char* source_string);
|
160
|
+
|
161
|
+
// Call the compilation step for the specific context
|
162
|
+
int sass_compile_file_context (struct Sass_File_Context* ctx);
|
163
|
+
int sass_compile_data_context (struct Sass_Data_Context* ctx);
|
164
|
+
|
165
|
+
// Create a sass compiler instance for more control
|
166
|
+
struct Sass_Compiler* sass_make_file_compiler (struct Sass_File_Context* file_ctx);
|
167
|
+
struct Sass_Compiler* sass_make_data_compiler (struct Sass_Data_Context* data_ctx);
|
168
|
+
|
169
|
+
// Execute the different compilation steps individually
|
170
|
+
// Usefull if you only want to query the included files
|
171
|
+
int sass_compiler_parse(struct Sass_Compiler* compiler);
|
172
|
+
int sass_compiler_execute(struct Sass_Compiler* compiler);
|
173
|
+
|
174
|
+
// Release all memory allocated with the compiler
|
175
|
+
// This does _not_ include any contexts or options
|
176
|
+
void sass_delete_compiler(struct Sass_Compiler* compiler);
|
177
|
+
|
178
|
+
// Release all memory allocated and also ourself
|
179
|
+
void sass_delete_file_context (struct Sass_File_Context* ctx);
|
180
|
+
void sass_delete_data_context (struct Sass_Data_Context* ctx);
|
181
|
+
|
182
|
+
// Getters for Context from specific implementation
|
183
|
+
struct Sass_Context* sass_file_context_get_context (struct Sass_File_Context* file_ctx);
|
184
|
+
struct Sass_Context* sass_data_context_get_context (struct Sass_Data_Context* data_ctx);
|
185
|
+
|
186
|
+
// Getters for Context_Options from Sass_Context
|
187
|
+
struct Sass_Options* sass_context_get_options (struct Sass_Context* ctx);
|
188
|
+
struct Sass_Options* sass_file_context_get_options (struct Sass_File_Context* file_ctx);
|
189
|
+
struct Sass_Options* sass_data_context_get_options (struct Sass_Data_Context* data_ctx);
|
190
|
+
void sass_file_context_set_options (struct Sass_File_Context* file_ctx, struct Sass_Options* opt);
|
191
|
+
void sass_data_context_set_options (struct Sass_Data_Context* data_ctx, struct Sass_Options* opt);
|
192
|
+
|
193
|
+
// Getters for Sass_Context values
|
194
|
+
const char* sass_context_get_output_string (struct Sass_Context* ctx);
|
195
|
+
int sass_context_get_error_status (struct Sass_Context* ctx);
|
196
|
+
const char* sass_context_get_error_json (struct Sass_Context* ctx);
|
197
|
+
const char* sass_context_get_error_text (struct Sass_Context* ctx);
|
198
|
+
const char* sass_context_get_error_message (struct Sass_Context* ctx);
|
199
|
+
const char* sass_context_get_error_file (struct Sass_Context* ctx);
|
200
|
+
size_t sass_context_get_error_line (struct Sass_Context* ctx);
|
201
|
+
size_t sass_context_get_error_column (struct Sass_Context* ctx);
|
202
|
+
const char* sass_context_get_source_map_string (struct Sass_Context* ctx);
|
203
|
+
char** sass_context_get_included_files (struct Sass_Context* ctx);
|
204
|
+
|
205
|
+
// Take ownership of memory (value on context is set to 0)
|
206
|
+
char* sass_context_take_error_json (struct Sass_Context* ctx);
|
207
|
+
char* sass_context_take_error_text (struct Sass_Context* ctx);
|
208
|
+
char* sass_context_take_error_message (struct Sass_Context* ctx);
|
209
|
+
char* sass_context_take_error_file (struct Sass_Context* ctx);
|
210
|
+
char* sass_context_take_output_string (struct Sass_Context* ctx);
|
211
|
+
char* sass_context_take_source_map_string (struct Sass_Context* ctx);
|
212
|
+
|
213
|
+
// Push function for plugin/include paths (no manipulation support for now)
|
214
|
+
void sass_option_push_plugin_path (struct Sass_Options* options, const char* path);
|
215
|
+
void sass_option_push_include_path (struct Sass_Options* options, const char* path);
|
216
|
+
```
|
217
|
+
|
218
|
+
### Sass Options API
|
219
|
+
|
220
|
+
```C
|
221
|
+
// Getters for Context_Option values
|
222
|
+
int sass_option_get_precision (struct Sass_Options* options);
|
223
|
+
enum Sass_Output_Style sass_option_get_output_style (struct Sass_Options* options);
|
224
|
+
bool sass_option_get_source_comments (struct Sass_Options* options);
|
225
|
+
bool sass_option_get_source_map_embed (struct Sass_Options* options);
|
226
|
+
bool sass_option_get_source_map_contents (struct Sass_Options* options);
|
227
|
+
bool sass_option_get_omit_source_map_url (struct Sass_Options* options);
|
228
|
+
bool sass_option_get_is_indented_syntax_src (struct Sass_Options* options);
|
229
|
+
const char* sass_option_get_indent (struct Sass_Options* options);
|
230
|
+
const char* sass_option_get_linefeed (struct Sass_Options* options);
|
231
|
+
const char* sass_option_get_input_path (struct Sass_Options* options);
|
232
|
+
const char* sass_option_get_output_path (struct Sass_Options* options);
|
233
|
+
const char* sass_option_get_plugin_path (struct Sass_Options* options);
|
234
|
+
const char* sass_option_get_include_path (struct Sass_Options* options);
|
235
|
+
const char* sass_option_get_source_map_file (struct Sass_Options* options);
|
236
|
+
const char* sass_option_get_source_map_root (struct Sass_Options* options);
|
237
|
+
Sass_C_Function_List sass_option_get_c_functions (struct Sass_Options* options);
|
238
|
+
Sass_C_Import_Callback sass_option_get_importer (struct Sass_Options* options);
|
239
|
+
|
240
|
+
// Setters for Context_Option values
|
241
|
+
void sass_option_set_precision (struct Sass_Options* options, int precision);
|
242
|
+
void sass_option_set_output_style (struct Sass_Options* options, enum Sass_Output_Style output_style);
|
243
|
+
void sass_option_set_source_comments (struct Sass_Options* options, bool source_comments);
|
244
|
+
void sass_option_set_source_map_embed (struct Sass_Options* options, bool source_map_embed);
|
245
|
+
void sass_option_set_source_map_contents (struct Sass_Options* options, bool source_map_contents);
|
246
|
+
void sass_option_set_omit_source_map_url (struct Sass_Options* options, bool omit_source_map_url);
|
247
|
+
void sass_option_set_is_indented_syntax_src (struct Sass_Options* options, bool is_indented_syntax_src);
|
248
|
+
void sass_option_set_indent (struct Sass_Options* options, const char* indent);
|
249
|
+
void sass_option_set_linefeed (struct Sass_Options* options, const char* linefeed);
|
250
|
+
void sass_option_set_input_path (struct Sass_Options* options, const char* input_path);
|
251
|
+
void sass_option_set_output_path (struct Sass_Options* options, const char* output_path);
|
252
|
+
void sass_option_set_plugin_path (struct Sass_Options* options, const char* plugin_path);
|
253
|
+
void sass_option_set_include_path (struct Sass_Options* options, const char* include_path);
|
254
|
+
void sass_option_set_source_map_file (struct Sass_Options* options, const char* source_map_file);
|
255
|
+
void sass_option_set_source_map_root (struct Sass_Options* options, const char* source_map_root);
|
256
|
+
void sass_option_set_c_functions (struct Sass_Options* options, Sass_C_Function_List c_functions);
|
257
|
+
void sass_option_set_importer (struct Sass_Options* options, Sass_C_Import_Callback importer);
|
258
|
+
|
259
|
+
// Push function for paths (no manipulation support for now)
|
260
|
+
void sass_option_push_plugin_path (struct Sass_Options* options, const char* path);
|
261
|
+
void sass_option_push_include_path (struct Sass_Options* options, const char* path);
|
262
|
+
```
|
263
|
+
|
264
|
+
### More links
|
265
|
+
|
266
|
+
- [Sass Context Example](api-context-example.md)
|
267
|
+
- [Sass Context Internal](api-context-internal.md)
|
268
|
+
|