private ILessEngine GetEngine() { var importer = new Importer(new FileReader(new CustomPathResolver(filePath))); var parser = new Parser(new PlainStylizer(), importer); var engine = new LessEngine(parser); return engine; }
private ILessEngine GetEngine() { var importer = new Importer(new CustomFileReader(fileSystem, filePath)); var parser = new Parser(new PlainStylizer(), importer); var engine = new LessEngine(parser) { Compress = true }; return engine; }
ILessEngine CreateLessEngine(string path) { var importer = new Importer(new MulderFileReader(fileSystem, path)); var parser = new Parser(new PlainStylizer(), importer); var engine = new LessEngine(parser) { Compress = true }; return engine; }
private ILessEngine GetLessEngine(string physicalPath) { var basePath = Path.GetDirectoryName(physicalPath); var stylizer = new PlainStylizer(); var importer = new Importer(new FileReader(new BasePathResolver(basePath))); var parser = new Parser(stylizer, importer) { NodeProvider = new RawUrlNodeProvider() }; var lessEngine = new LessEngine(parser); return lessEngine; }
public ILessEngine GetEngine(IFileSystem fileSystem, string directory) { IStylizer stylizer = new HtmlStylizer(); IPathResolver pathResolver = new TestPathResolver(directory); IFileReader reader = new TestFileReader(fileSystem, pathResolver); var importer = new Importer(reader); var parser = new Parser(stylizer, importer); ILogger logger = new ConsoleLogger(LogLevel.Error); return new LessEngine(parser, logger, true, true); }
public static string Generate(string fileName, string less, string color1, string color2) { var reader = new CustomFileReader(color1, color2); var importer = new Importer(reader); var parser = new Parser(new PlainStylizer(), importer, false); var lessEngine = new LessEngine(parser, NullLogger.Instance, true, false); less = Regex.Replace(less, "\\.theme-color\\(([a-z-]+),? ?", Evaluate); lessEngine.CurrentDirectory = Path.GetDirectoryName(fileName); return lessEngine.TransformToCss(less, Path.GetFileName(fileName)); }
protected override string ReadFileContent(string fileSystemPath, bool minify) { var directory = Path.GetDirectoryName(fileSystemPath); var pathResolver = new AbsolutePathResolver(directory); var fileReader = new FileReader { PathResolver = pathResolver }; var importer = new Importer { FileReader = fileReader }; var parser = new Parser { Importer = importer }; var lessEngine = new LessEngine { Parser = parser }; var rawFileContent = base.ReadFileContent(fileSystemPath, false); return lessEngine.TransformToCss(rawFileContent, fileSystemPath); }
public ImportScope(Importer importer, string path) { this.importer = importer; this.importer._paths.Add(path); }