updated comments for import and from_paths
This commit is contained in:
parent
ec5ab05330
commit
5c20c00d6d
10
src/lib.rs
10
src/lib.rs
@ -143,6 +143,16 @@ pub fn from_path(p: &str) -> Result<String> {
|
|||||||
from_paths(p, &Vec::new())
|
from_paths(p, &Vec::new())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Compile CSS from a file and load in additional files through importing them
|
||||||
|
/// note: @use is currently unsupported
|
||||||
|
///
|
||||||
|
/// ```
|
||||||
|
/// fn main() -> Result<(), Box<grass::Error>> {
|
||||||
|
/// let sass = grass::from_paths("input.scss", &[std::path::Path::new("benches")])?;
|
||||||
|
/// Ok(())
|
||||||
|
/// }
|
||||||
|
/// ```
|
||||||
|
/// (grass does not currently allow files or paths that are not valid UTF-8)
|
||||||
#[cfg_attr(feature = "profiling", inline(never))]
|
#[cfg_attr(feature = "profiling", inline(never))]
|
||||||
#[cfg_attr(not(feature = "profiling"), inline)]
|
#[cfg_attr(not(feature = "profiling"), inline)]
|
||||||
#[cfg(not(feature = "wasm"))]
|
#[cfg(not(feature = "wasm"))]
|
||||||
|
@ -9,8 +9,8 @@ use super::{Parser, Stmt};
|
|||||||
|
|
||||||
/// Searches the current directory of the file then searches in load paths directories
|
/// Searches the current directory of the file then searches in load paths directories
|
||||||
/// if the import has not yet been found.
|
/// if the import has not yet been found.
|
||||||
/// [https://sass-lang.com/documentation/at-rules/import#finding-the-file](finding a file)
|
/// <https://sass-lang.com/documentation/at-rules/import#finding-the-file>
|
||||||
/// [https://sass-lang.com/documentation/at-rules/import#load-paths](load path)
|
/// <https://sass-lang.com/documentation/at-rules/import#load-paths>
|
||||||
fn find_import(file_path: &PathBuf, name: &OsStr, load_paths: &[&Path]) -> Option<PathBuf> {
|
fn find_import(file_path: &PathBuf, name: &OsStr, load_paths: &[&Path]) -> Option<PathBuf> {
|
||||||
let paths = [
|
let paths = [
|
||||||
file_path.with_file_name(name).with_extension("scss"),
|
file_path.with_file_name(name).with_extension("scss"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user