Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

docpad-plugin-less

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docpad-plugin-less - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

5

History.md
## History
- v2.1.2 December 5, 2012
- Better error reporting
- We now parse less files with the `filename` option set to the file's `fullPath` (before we didn't send this at all)
- Added `parseOptions` and `compileOptions` to configuration
- v2.1.1 August 10, 2012

@@ -4,0 +9,0 @@ - Re-added markdown files to npm distribution as they are required for the npm website

38

out/less.plugin.js

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.3.3
// Generated by CoffeeScript 1.4.0
(function() {

@@ -20,2 +20,4 @@ var __hasProp = {}.hasOwnProperty,

compress: true,
parseOptions: null,
compileOptions: null,
environments: {

@@ -29,3 +31,4 @@ development: {

LessPlugin.prototype.render = function(opts, next) {
var dirPath, file, inExtension, less, options, outExtension, path, srcPath, templateData;
var config, dirPath, file, inExtension, key, less, outExtension, parseOptions, path, srcPath, templateData, value, _ref;
config = this.config;
inExtension = opts.inExtension, outExtension = opts.outExtension, templateData = opts.templateData, file = opts.file;

@@ -37,13 +40,32 @@ if (inExtension === 'less' && (outExtension === 'css' || outExtension === null)) {

dirPath = path.dirname(srcPath);
options = {
parseOptions = {
paths: [dirPath],
compress: this.config.compress
filename: file.get('fullPath')
};
return new less.Parser(options).parse(opts.content, function(err, tree) {
if (config.parseOptions) {
_ref = config.parseOptions;
for (key in _ref) {
if (!__hasProp.call(_ref, key)) continue;
value = _ref[key];
parseOptions[key] = value;
}
}
return new less.Parser(parseOptions).parse(opts.content, function(err, tree) {
var compileOptions, _ref1;
if (err) {
err = new Error(less.formatError(err, parseOptions));
return next(err);
}
opts.content = tree.toCSS({
compress: options.compress
});
compileOptions = {
compress: config.compress
};
if (config.compileOptions) {
_ref1 = config.compileOptions;
for (key in _ref1) {
if (!__hasProp.call(_ref1, key)) continue;
value = _ref1[key];
compileOptions[key] = value;
}
}
opts.content = tree.toCSS(compileOptions);
return next();

@@ -50,0 +72,0 @@ });

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.3.3
// Generated by CoffeeScript 1.4.0
(function() {

@@ -3,0 +3,0 @@ var __hasProp = {}.hasOwnProperty,

{
"name": "docpad-plugin-less",
"version": "2.1.1",
"version": "2.1.2",
"description": "Adds support for the LESS CSS pre-processor to DocPad",
"homepage": "https://github.com/bevry/docpad-extras",
"homepage": "http://docpad.org/plugin/less",
"keywords": [

@@ -10,2 +10,3 @@ "docpad",

"less",
"less.js",
"lesscss",

@@ -38,3 +39,3 @@ "css",

"devDependencies": {
"coffee-script": "1.3.x"
"coffee-script": "1.4.x"
},

@@ -41,0 +42,0 @@ "main": "./out/less.plugin.js",

# LessCSS Plugin for DocPad
Adds support for the [LESS](http://lesscss.org/) CSS pre-processor to [DocPad](https://github.com/bevry/docpad)
Adds support for the [LESS](http://lesscss.org/) CSS pre-processor to [DocPad](https://docpad.org)

@@ -4,0 +4,0 @@ Convention: `.css.less`

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc