1b2e7d2016-11-23Pontus Östlund /* Author: Pontus Östlund <https://profiles.google.com/poppanator> Permission to copy, modify, and distribute this source for any legal purpose granted as long as my name is still attached to it. More specifically, the GPL, LGPL and MPL licenses apply to this software. */ #pike __REAL_VERSION__ #require constant(Tools._Sass) //! @ignore inherit Tools@module@; //! @endignore //! SCSS compiler class SCSS { inherit Tools@module@._Api;
dd8a1a2016-11-29Pontus Östlund  //! Set options to the SASS compiler. @[opts]
1b2e7d2016-11-23Pontus Östlund  //! //! @param opts //! @mapping //! @member int "output_style" //! Any of the @[STYLE_NESTED], @[STYLE_EXPANDED], @[STYLE_COMPACT] //! or @[STYLE_COMPRESSED] constants. See also @[set_output_style()]. //! @member string "include_path" //! Path to root of incude files. See also @[set_include_path()]. //! @member string "source_map_file" //! File to write source map file to. Only has effect in @[compile_file()]. //! See also @[set_source_map_file()]. //! @member bool "source_comments" //! Turn on/off comments in the output containing info about the source
ef03332016-11-26Pontus Östlund  //! file - line numbers and such. Default of @tt{false@}. See also
1b2e7d2016-11-23Pontus Östlund  //! @[set_source_comments()]. //! @member bool "source_map_embed" //! Turn on/off if a source map should be embedded in the output or not.
ef03332016-11-26Pontus Östlund  //! Default is @tt{false@}. See also @[set_source_map_embed()].
1b2e7d2016-11-23Pontus Östlund  //! @endmapping void set_options(mapping(string:string|int) opts) { foreach (opts; string opt; string|int val) { switch (opt) { case "output_style": if (!intp(val)) { error("Value to set_output_style() must be an integer!\n"); } set_output_style(val); break; case "include_path": if (!stringp(val)) { error("Value to set_include_path() must be a string!\n"); } set_include_path(val); break; case "source_map_file": if (!stringp(val)) { error("Value to set_source_map_file() must be a string!\n"); } set_source_map_file(val); break; case "source_map_embed": if (!intp(val)) {
18ad792016-11-24Pontus Östlund  error("Value to set_source_map_embed() must be an int(0..1)!\n");
1b2e7d2016-11-23Pontus Östlund  } set_source_map_embed(val); break;
18ad792016-11-24Pontus Östlund  case "source_map_root": if (!stringp(val)) { error("Value to set_source_map_root() must be a string!\n"); } set_source_map_root(val); break; case "omit_source_map": if (!intp(val)) { error("Value to set_omit_source_map_url() must be an integer!\n"); } set_omit_source_map_url(val); break;
1b2e7d2016-11-23Pontus Östlund  case "source_comments": if (!intp(val)) { error("Value to set_source_comments() must be an integer!\n"); } set_source_comments(val); break;
18ad792016-11-24Pontus Östlund  default: error("Unknown option %O!\n", opt);
1b2e7d2016-11-23Pontus Östlund  } } }
dd8a1a2016-11-29Pontus Östlund  // //! Test if @[set_options()] will be linked to from @[a]? // //! // //! @param a // //! Just a parameter // void test_func(mapping a) // { // return a; // }
1b2e7d2016-11-23Pontus Östlund }