Malva is a configurable, smart and fast CSS, SCSS, Sass and Less formatter.
Basic Usage
You can format source code string by using [format_text
] function.
use ;
let options = default;
assert_eq!;
For detailed documentation of configuration, please refer to Configuration on GitHub.
If there're syntax errors in source code, it will return Err
:
use ;
let options = default;
assert!;
Print AST
If you have already parsed the AST with Raffia,
you can use [print_stylesheet
] to print it.
Please note that though you have AST,
you still need to provide comments and specify syntax,
also create [LineBounds
] manually.
use ;
use ;
let input = "a{color:red}";
let mut comments = vec!;
let mut parser = new
.syntax
.comments
.build;
let stylesheet = parser..unwrap;
let options = default;
let line_bounds = new;
assert_eq!;