grass
grass copied to clipboard
[feature request] "Built-in" modules
Hi!
I would like to be able to specify fake module "load path", which just uses in-memory &str
. My use case is generating syntax highlighting CSS via syntect and then embedding it into an SCSS file, but it could also be useful for providing "standard library"-like features when embedding SCSS compiler.
Currently you can configure that using Options::load_path
but that still requires separate file, most likely can be done using separate file. We might need to have another file resolver if we want to have this feature, may have extra cost in complexity I believe. But internally it stores stuff as codemap::File
so I guess it shouldn't be that hard?
Hi @GoldsteinE,
I think the Fs
trait may be what you're looking for. You can find a simple example of what it sounds like you're describing in our tests, https://github.com/connorskees/grass/blob/89d72015871523e4e1451545be6c3a9fd53a745b/tests/macros.rs#L114-L130
Closing this as implemented. Please feel free to reopen this issue if you find that the Fs
trait is not a sufficiently robust solution to the problem you're describing.