Giter Site home page Giter Site logo

less.js-windows's Introduction

LESS.js for Windows

A standalone version of the LESS command-line compiler that will run on Windows with no other dependencies.

Consists of a standalone version of Node.js and the required less.js files/dependencies.

Install

Download and extract the release ZIP and invoke lessc.cmd as detailed below.

Usage

Basic usage:

lessc  path\source.less  path\output.css

Compress CSS:

lessc  --clean-css  path\source.less  path\output.css

For full usage:

lessc -h

History

Previously the project used the Windows Script Host cscript.exe as its runtime. Over time this was proving to be diffcult to support as it was essentially using the browser-based version of less.js and stubbing out objects like window and document to mimic the browser environment. This version is still available in the windows-script-host branch.

less.js-windows's People

Contributors

adamjgrant avatar duncansmart avatar eduardp avatar gutek avatar jaredfholgate avatar rekka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

less.js-windows's Issues

Imported Less File, Appends Sub-Directory to url() styles

When building the less files with the following directory structure:

Styles
Styles/Home

With main less at root of Styles and import less files in home, I would get the following result for every background-image: url().

background-image: url('Home/Home../Images/Image.jpg");

from the original:

background-image: url("../Images/Image.jpg");

I do not know why it is prefixing these items, but it is stopping me from being able to use sub-directories for my less compilation.

Not sure if this an issue with Less.js or the windows Script.

missing module when --clean-css used

I just upgraded to your latest ver (from the zip). Default usage works fine but --clean-css (as in the README) fails:

t:\dev\less.js-windows>lessc --clean-css x:\x.css
Error: Cannot find module '../images/url-rewriter'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (t:\dev\less.js-windows\bin\node_modules\clean-css\lib\imports\inliner.js:4:19)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

Same if I use node.exe directly.

Remove Read-Only flag from css files

Hi

The following revision to the .wsf file removes read-only flags from css files to stop the script bombing out. This is particularly relevant for those of us using TFS. This is my first time in GitHub, so I apologise for not submitting the code properly, but I have no idea how to.

It checks for the existence of a file before checking and removing its read-only flag in the convert method.

Regards

Jared

 <!--  
 Less.js compiler for Windows Script Host  
 http://blog.dotsmart.net/  
 Copyright (c) 2010, Duncan Smart  
 Licensed under the Apache 2.0 License.  
 -->  
 <job>  
 <script language="jscript">  
    // Stub out globals  
   var window = this;  
   var location = window.location = {   
     port: 0,  
     href: ''  
   };  
   var fso = new ActiveXObject("Scripting.FileSystemObject");  
   var input = null;  
   var util = {  
     readText: function (filename) {  
       //WScript.StdErr.WriteLine("readText: " + filename);  
       var file = fso.OpenTextFile(filename);  
       // Don't error on empty files  
       var text = file.AtEndOfStream ? '' : file.ReadAll();  
       // Strip off any UTF-8 BOM  
       var utf8bom = String.fromCharCode(0xEF, 0xBB, 0xBF);  
       if (text.substr(0, utf8bom.length) == utf8bom) {  
         text = text.substr(utf8bom.length);  
       }  
       file.Close();  
       return text;  
     }  
   };  
   // XMLHttpRequest that just gets local files. Used when processing "@import"  
   function XMLHttpRequest(){}  
   XMLHttpRequest.prototype = {  
     open: function (method, url, async) {  
       this.url = url;  
     },  
     send: function () {  
       // get the file path relative to the input less file/directory  
       var currDir = fso.folderExists(input) ? input : fso.getParentFolderName(input);  
       var filename = fso.BuildPath(currDir, this.url);  
       //WScript.StdErr.WriteLine("XHR.send " + filename);  
       // Little hack so *.less will resolve to *.less.css also. Helps with Visual Studio   
       // ensuring that file BuildAction is set to Content and you get rudimentary syntax highlighting with no set up.  
       if (filename.match(/.less$/i) && !fso.FileExists(filename)) {  
         filename = filename.replace(/.less$/i, '.less.css');  
       }  
       try {  
         this.status = 200;  
         this.responseText = util.readText(filename);  
       }  
       catch (e) {  
         this.status = 404;  
         this.responseText = e.description;  
       }  
     },  
     setRequestHeader: function () {},  
     getResponseHeader: function () {}  
   };  
   // Fake document  
   var document = {  
     _dummyElement: {  
       childNodes: [],   
       appendChild: function(){},  
       style: {}  
     },  
     getElementsByTagName: function(){ return []; },  
     getElementById: function(){ return this._dummyElement; },  
     createElement: function(){ return this._dummyElement; },  
     createTextNode: function(){ return this._dummyElement; }  
   };      
 </script>  
 <!-- less.js from https://github.com/cloudhead/less.js/tree/master/dist/ -->  
 <script language="jscript" src="less-1.3.0.js" />  
 <script language="jscript">   
   // Parse args  
   var args = {};  
   for (var i = 0; i < WScript.Arguments.Length; i++) {  
     var arg = WScript.Arguments.Item(i);  
     // Handle "-switch" and "--switch"  
     var match = arg.match(/^--?([a-z][0-9a-z-]*)$/i);  
     if (match) {  
       i = match[1];  
       arg = true;  
     }  
     args[i] = arg;  
   }  
   input = args[0];  
   var output = args[1];  
   if (fso.folderExists(input)) {  
     input = fso.getAbsolutePathName(input);  
     var files = getFiles(input, /\.less$/i);  
     for (var i = 0; i < files.length; i++) {  
       var file = files[i];  
       convert(file.path, output + '\\' + file.name.replace( /\.less$/i, '.css'));  
     }  
   }  
   else {  
     if (fso.folderexists(output)) {  
       output = fso.getAbsolutePathName(output) + '\\' + fso.getfile(input).name.replace(/\.less$/i, '.css');  
     }  
     convert(input, output);  
   }  
   // Returns array of {name:'foo.bar', path:'c:\baz\foo.bar'} for given directory and pattern  
   function getFiles(dir, regex) {  
     var e = new Enumerator(fso.getFolder(dir).files);  
     var files = []  
     for (; !e.atEnd(); e.moveNext()) {  
       if (regex.test(e.item().path)) {  
         files.push({  
           name: e.item().name,   
           path: e.item().path  
         });  
       }  
     }  
     return files;  
   }  
   function convert(input, output) {  
     if (!input) {  
       WScript.StdErr.WriteLine("lessc.wsf: no input files");  
       WScript.StdErr.WriteLine("Usage:");  
       WScript.StdErr.WriteLine(" Single file: cscript //nologo lessc.wsf input.less [output.css] [-compress]");  
       WScript.StdErr.WriteLine(" Directory:  cscript //nologo lessc.wsf inputdir outputdir [-compress]");  
       WScript.Quit(1);  
     }  
     var data;  
     if (input == '-') {  
       var chunks = [];  
       while (!WScript.StdIn.AtEndOfStream)  
       chunks.push(WScript.StdIn.ReadAll());  
       data = chunks.join('');  
     }  
     else {  
       data = util.readText(input);  
     }  
     var parser = new less.Parser({  
       filename: input  
     });  
     try {  
       parser.parse(data, function (err, tree) {  
         if (err) {  
           WScript.StdErr.WriteLine("ERR: ");  
           for (var i in err) {  
             if (err[i]) {  
               WScript.StdErr.WriteLine(" " + i + ': ' + err[i]);  
             }  
           }  
           WScript.Quit(2);  
         }  
         else {  
           var css = tree.toCSS({  
             compress: args.compress  
           });  
           if (output) {  
                               if(fso.FileExists(output))  
                               {  
                                    var checkfile = fso.GetFile(output);  
                                    if(checkfile.Attributes & 1)  
                                    {  
                                         checkfile.Attributes = checkfile.Attributes ^ 1  
                                    }  
                               }  
             var outputfile = fso.CreateTextFile(output,true);  
             outputfile.Write(css);  
             outputfile.Close();  
           }  
           else {  
             WScript.StdOut.Write(css);  
           }  
         }  
       });  
     }  
     catch (e) {  
       WScript.StdErr.WriteLine("ERROR:");  
       for (var i in e) {  
         if (e[i]) {  
           WScript.StdErr.WriteLine(" " + i + ': ' + e[i]);  
         }  
       }  
       WScript.Quit(3);  
     }  
     // Sometimes less will return errors inside the fake HTML element  
     if (document._dummyElement.innerHTML && document._dummyElement.innerHTML.match(/Syntax Error/i)) {  
       var s = document._dummyElement.innerHTML;  
       s = s.replace(/<[^>]+(\/?)>/g, function (m) { return m.indexOf('/') > 0 && m !== '</label>' ? "\n" : '' });  
       s = s.replace(/\n+/g, '\n');  
       WScript.StdErr.WriteLine("ERR: ");  
       WScript.StdErr.WriteLine(s);  
       WScript.Quit(2);  
     }  
   }  
 </script>  
 </job>  

Docs wrong

--clean-css options does not work. I get the following output:

"Unable to interpret argument clean-css - if it is a plugin (less-plugin-clean-css), make sure that it is installed under or at the same level as less"

Using the '&'-operator after a subselector doesn't work as expected

Using the ‘&’ operator after a selector doesn’t work properly. In the output the ‘&’ parts get places before the subselector instead of after it:

#main {
    #content {
        .class {
            position: absolute;
            #container & {
                position: relative;
            }
        }
    }
}

Should output:

#main #content .class { 
    position: absolute; 
}
#container #main #content .class { 
    position:relative; 
}

But this is what it does output:

#main #content .class { 
    position: absolute; 
}
#main #content .class #container { 
    position: relative; 
}

Note: this usage of the ‘&’-operator isn’t documented. In the documentation it only shows the operator being used before a selector. However, it does work when trying this example in the browswer.

Relative paths in imported files do not work correctly

When importing a less file the less.js changes the relative paths in that file so they will still work. Example:

File structure:

main.less
    imports
        subdirectory
            import.less

main.less:

@import "imports/subdirectory/import";

import.less:

.example {
    background-image: url('../images/bg.gif');
}

Expected output:

.example {
    background-image: url('imports/subdirectory/../images/bg.gif');
}

But it becomes:

.example {
    background-image: url('imports/subdirectory/imports/subdirectory/../images/bg.gif');
}

Edit:
The behavior changed in less.js version 1.1.5, but is still wrong.

Edit2: The behavior is back to the original issue again, since the hotfix of 1.1.5. Updated the example above.

Mixin url paths not being transformed based upon import

I am coming from dotless and I am not sure if it was something specific to that but if I had a base mixin file and any urls were included within there, any subsequent imports of the mixins would correct the paths based upon the import statement.

So for example if I had the following:

  • root
    • images
      • background.jpg
    • mixins.less (has mixin called .with-background which references url images/background.jpg)
    • themes
      • default
        • default.less (imports mixins.less and uses .with-background)

In the above example the default.less file will be using the following url for the image:
root/themes/default/images/background.jpg
rather than what it should be:
root/images/background.jpg

So is there a way to hint paths or some pattern to handle this use case?

doesn't work on win8 pro

I set the PATH variable with the less.js-windows directory and installed the LESS2CSS ST2 plugin, but when I try to compile the .less to css a prompt window appears and immediately stop working and nothing is done.
issue

I"m getting Error 1, any ideas what that is?

I'm executing this through wscript, eg. errCode = oScript.Shell.Run(path,0,true) and it's returning error code 1. (path = %comspec% /c c:\less\lessc.cmd c:\mystuff\less\styles.less c:\mysuff\css\styles.css). Running interactively at a cmd prompt doesn't throw an error, but the everyone group has modify on all these paths just for testing.

not generating css file

I apologize if I am missing something, but I can't seem to get WinLess to actually create the CSS file. It shows a success compiler result, but no css file is created that I can see.
I am pointing it at a directory with a single less file in it - square-media-grid.less.
Thanks, d

404 Issue

If I run the command lessc test.less anything.css I get the following:

ERROR:
   name: Error
   description: Couldn't load test-import.less (404)
   message: Couldn't load test-import.less (404)

I can see that you're using AJAX requests through the WSF file and using cscript to compile it for use locally. I'm running the following command:

lessc test.less rar.css

The "test.less" file is definitely in the same directory as when I call it.

Any ideas?

Permission denied?

I'm trying to use this as a drop in replacement for lessc in Django with django-compressor, and I get the traceback below. Running the lessc.cmd with the same arguments seems to work find. Any suggestions?

FilterError at /editor/design/
ERROR:
name: Error
number: -2146828218
description: Permission denied
message: Permission denied
Request Method: GET
Request URL: http://whatisjasongoldstein.bs:8000/editor/design/?t=500.html
Django Version: 1.4
Exception Type: FilterError
Exception Value:
ERROR:
name: Error
number: -2146828218
description: Permission denied
message: Permission denied
Exception Location: C:\Python27\lib\site-packages\compressor\filters\base.py in input, line 133
Python Executable: C:\Python27\python.exe
Python Version: 2.7.2
Python Path:
['C:\Users\Jason\dev\portfolios',
'C:\Python27\lib\site-packages\virtualenv-1.7-py2.7.egg',
'C:\Python27\lib\site-packages\pip-1.0.2-py2.7.egg',
'C:\Windows\system32\python27.zip',
'C:\Python27\DLLs',
'C:\Python27\lib',
'C:\Python27\lib\plat-win',
'C:\Python27\lib\lib-tk',
'C:\Python27',
'C:\Python27\lib\site-packages',
'C:\Python27\lib\site-packages\PIL',
'C:\Python27\lib\site-packages\win32',
'C:\Python27\lib\site-packages\win32\lib',
'C:\Python27\lib\site-packages\Pythonwin',
'C:/Users/Jason/dev/portfolios/apps',
'C:/Users/Jason/dev/portfolios//apps',
'C:/Users/Jason/dev/portfolios//apps']
Server time: Sun, 29 Apr 2012 02:38:50 -0500
Error during template rendering

In template C:\Users\Jason\dev\portfolios\templates\editor\base.html, error at line 13
ERROR: name: Error number: -2146828218 description: Permission denied message: Permission denied
3
4 <title>Edit Portfolio: {{ request.client }}</title>
5
6 {% comment %}
7
8 <style type="text/css">
9 @import url({{ STATIC_URL }}ui-lightness/jquery-ui-1.8.19.custom.css);
10 @import url({{ STATIC_URL }}editor/css/editor.less); /* Goes last */
11 </style>
12 {% endcomment %}
13 {% compress css %}
14
15
16
17 {% endcompress %}
18
19
20
21


22

Editor


23

For {{ request.client }}'s portfolio


Traceback Switch back to interactive view

Request information

GET
Variable Value
t
u'500.html'
POST
No POST data
FILES
No FILES data
COOKIES
Variable Value
csrftoken
'XAZwxNuL0yuAE5fDVuIHyAcETY9Gp7nl'
djdt
'hide'
sessionid
'776ea86ddfcb0e0875288d5ed28770ef'
jsuid
'4085348621'
META
Variable Value
RUN_MAIN
'true'
HTTP_REFERER
'http://whatisjasongoldstein.bs:8000/editor/design/'
SERVER_SOFTWARE
'WSGIServer/0.1 Python/2.7.2'
SCRIPT_NAME
u''
REQUEST_METHOD
'GET'
SERVER_PROTOCOL
'HTTP/1.1'
SYSTEMROOT
'C:\Windows'
TSMPATH
'C:\Program Files\ThinkPad\UltraNav Utility'
COM.ADOBE.VERSIONCUE.CLIENT.APPVERSION
'1.0.0'
CONTENT_LENGTH
''
ACPATH
'C:\Program Files (x86)\Lenovo\Access Connections'
RR
'C:\Program Files (x86)\Lenovo\Rescue and Recovery'
USERDOMAIN
'JG-II'
COMSPEC
'C:\Windows\system32\cmd.exe'
WINDIR
'C:\Windows'
HTTP_CACHE_CONTROL
'max-age=0'
SESSIONNAME
'Console'
HTTP_ACCEPT
'text/html,application/xhtml+xml,application/xml;q=0.9,
/;q=0.8'
wsgi.version
(1, 0)
HOMEDRIVE
'C:'
SYSTEMDRIVE
'C:'
wsgi.multiprocess
False
PROCESSOR_LEVEL
'6'
OS
'Windows_NT'
HTTP_COOKIE
'jsuid=4085348621; djdt=hide; sessionid=776ea86ddfcb0e0875288d5ed28770ef; csrftoken=XAZwxNuL0yuAE5fDVuIHyAcETY9Gp7nl'
PATH_INFO
u'/editor/design/'
QUERY_STRING
't=500.html'
HTTP_ACCEPT_CHARSET
'ISO-8859-1,utf-8;q=0.7,
;q=0.3'
HTTP_USER_AGENT
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19'
HTTP_CONNECTION
'keep-alive'
TEMP
'C:\Users\Jason\AppData\Local\Temp'
REMOTE_ADDR
'127.0.0.1'
COMMONPROGRAMFILES(X86)
'C:\Program Files (x86)\Common Files'
wsgi.url_scheme
'http'
HOMEPATH
'\Users\Jason'
LOGONSERVER
'\JG-II'
CLASSPATH
'.;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip'
wsgi.multithread
True
ASL.LOG
'Destination=file;OnFirstLog=command,environment,parent'
SWSHARE
'C:\SWSHARE'
APPDATA
'C:\Users\Jason\AppData\Roaming'
COM.ADOBE.VERSIONCUE.CLIENT.APPLOCALE
'en_US'
VBOX_INSTALL_PATH
'C:\Program Files\Oracle\VirtualBox'
DJANGO_SETTINGS_MODULE
'portfolios.settings'
wsgi.file_wrapper
''
REMOTE_HOST
''
HTTP_ACCEPT_ENCODING
'gzip,deflate,sdch'
TMP
'C:\Users\Jason\AppData\Local\Temp'
COMPUTERNAME
'JG-II'
COM.ADOBE.VERSIONCUE.CLIENT.APPNAME
'AdobeDrive'
COMMONPROGRAMFILES
'C:\Program Files (x86)\Common Files'
TVTPYDIR
'C:\Program Files (x86)\Common Files\Lenovo\Python24'
TVT
'C:\Program Files (x86)\Lenovo'
PROCESSOR_ARCHITECTURE
'x86'
ALLUSERSPROFILE
'C:\ProgramData'
SERVER_PORT
'8000'
PROGRAMW6432
'C:\Program Files'
USERNAME
'Jason'
PROMPT
'$P$G'
HTTP_HOST
'whatisjasongoldstein.bs:8000'
PATHEXT
'.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC'
CONFIGSETROOT
'C:\Windows\ConfigSetRoot'
QTJAVA
'C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip'
wsgi.run_once
False
wsgi.errors
<open file '', mode 'w' at 0x01DA50D0>
HTTP_ACCEPT_LANGUAGE
'en-US,en;q=0.8'
NUMBER_OF_PROCESSORS
'4'
PROCESSOR_ARCHITEW6432
'AMD64'
PUBLIC
'C:\Users\Public'
USERPROFILE
'C:\Users\Jason'
PSMODULEPATH
'C:\Windows\system32\WindowsPowerShell\v1.0\Modules'
PROCESSOR_IDENTIFIER
'Intel64 Family 6 Model 37 Stepping 5, GenuineIntel'
PROGRAMFILES
'C:\Program Files (x86)'
PROCESSOR_REVISION
'2505'
PATH
'C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\ThinkPad\Bluetooth Software;C:\Program Files\ThinkPad\Bluetooth Software\syswow64;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files (x86)\Common Files\Lenovo;C:\Program Files (x86)\Common Files\Ulead Systems\MPEG;C:\Program Files (x86)\Lenovo\Access Connections;C:\Program Files\Common Files\Lenovo;C:\Program Files (x86)\Lenovo\Client Security Solution;C:\Program Files\Lenovo\Client Security Solution;C:\Python27;C:\Python27\Scripts;C:\Program Files (x86)\Common Files\Avid;C:\Program Files (x86)\Common Files\Avid;C:\Program Files\Common Files\Avid;C:\Program Files (x86)\Windows Live\Shared;C:\PROGRA1\DISKEE1\DISKEE~1;C:\Program Files (x86)\Calibre2;C:\Program Files (x86)\Mercurial;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files\TortoiseGit\bin;C:\Program Files\TortoiseHg;C:\Program Files (x86)\WinMerge;C:\MinGW\bin'
PROGRAMFILES(X86)
'C:\Program Files (x86)'
TFS_DIR
'C:\Program Files\ThinkVantage Fingerprint Software'
SERVER_NAME
'whatisjasongoldstein.bs'
LOCALAPPDATA
'C:\Users\Jason\AppData\Local'
PROGRAMDATA
'C:\ProgramData'
wsgi.input
<socket.fileobject object at 0x02E4F5B0>
FP_NO_HOST_CHECK
'NO'
GATEWAY_INTERFACE
'CGI/1.1'
CSRF_COOKIE
'XAZwxNuL0yuAE5fDVuIHyAcETY9Gp7nl'
XCHAT_WARNING_IGNORE
'true'
CONTENT_TYPE
'text/plain'
COMMONPROGRAMW6432
'C:\Program Files\Common Files'
TVTCOMMON
'C:\Program Files (x86)\Common Files\Lenovo'
Settings
Using settings module portfolios.settings
Setting Value
COMPRESS_URL
'/static/'
COMPRESS_OUTPUT_DIR
'CACHE'
USE_L10N
True
COMPRESS_DATA_URI_MAX_SIZE
1024
CSRF_COOKIE_SECURE
False
LANGUAGE_CODE
'en-us'
ROOT_URLCONF
'portfolios.urls'
MANAGERS
(('Jason Goldstein', '[email protected]'),)
COMPRESS_CSS_HASHING_METHOD
'mtime'
DEFAULT_CHARSET
'utf-8'
STATIC_ROOT
'C:/Users/Jason/dev/portfolios/static/'
COMPRESS_CLOSURE_COMPILER_ARGUMENTS
''
USE_THOUSAND_SEPARATOR
False
COMPRESS_OFFLINE_MANIFEST
'manifest.json'
MESSAGE_STORAGE
'django.contrib.messages.storage.fallback.FallbackStorage'
EMAIL_SUBJECT_PREFIX
'[Django] '
BASE_STATIC_URL
'/static/'
URL_VALIDATOR_USER_AGENT
'Django/1.4 (https://www.djangoproject.com)'
STATICFILES_FINDERS
('django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'django.contrib.staticfiles.finders.DefaultStorageFinder',
'compressor.finders.CompressorFinder')
COMPRESS_CSSTIDY_ARGUMENTS
'--template=highest'
SESSION_COOKIE_DOMAIN
None
SESSION_COOKIE_NAME
'sessionid'
ADMIN_FOR
()
TIME_INPUT_FORMATS
('%H:%M:%S', '%H:%M')
DATABASES
{'default': {'ENGINE': 'django.db.backends.mysql',
'HOST': '',
'NAME': 'portfolios',
'OPTIONS': {},
'PASSWORD': u'
******************
',
'PORT': '',
'TEST_CHARSET': None,
'TEST_COLLATION': None,
'TEST_MIRROR': None,
'TEST_NAME': None,
'TIME_ZONE': 'America/Chicago',
'USER': 'portfolios'}}
COMPRESS_YUI_BINARY
'java -jar yuicompressor.jar'
FILE_UPLOAD_PERMISSIONS
None
FILE_UPLOAD_HANDLERS
('django.core.files.uploadhandler.MemoryFileUploadHandler',
'django.core.files.uploadhandler.TemporaryFileUploadHandler')
DEFAULT_CONTENT_TYPE
'text/html'
COMPRESS_CSS_COMPRESSOR
'compressor.css.CssCompressor'
APPEND_SLASH
True
FIRST_DAY_OF_WEEK
0
DATABASE_ROUTERS
[]
YEAR_MONTH_FORMAT
'F Y'
COMPRESS_OFFLINE_TIMEOUT
31536000
STATICFILES_STORAGE
'django.contrib.staticfiles.storage.StaticFilesStorage'
CACHES
{'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': ''}}
SERVER_EMAIL
'[email protected]'
SESSION_COOKIE_PATH
'/'
COMPRESS_PARSER
'compressor.parser.AutoSelectParser'
COMPRESS_OFFLINE_CONTEXT
{'MEDIA_URL': '/media/', 'STATIC_URL': '/static/'}
COMPRESS_CACHE_BACKEND
'default'
MIDDLEWARE_CLASSES
('django.middleware.common.CommonMiddleware',
'multifolio.middleware.DomainMiddleware',
'seo.middleware.RedirectMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware')
USE_I18N
True
THOUSAND_SEPARATOR
','
SECRET_KEY
u'****************'
LANGUAGE_COOKIE_NAME
'django_language'
DEFAULT_INDEX_TABLESPACE
''
TRANSACTIONS_MANAGED
False
LOGGING_CONFIG
'django.utils.log.dictConfig'
SIGNING_BACKEND
'django.core.signing.TimestampSigner'
SEND_BROKEN_LINK_EMAILS
False
TEMPLATE_LOADERS
('django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'django.template.loaders.eggs.Loader')
WSGI_APPLICATION
None
TEMPLATE_DEBUG
True
X_FRAME_OPTIONS
'SAMEORIGIN'
CSRF_COOKIE_NAME
'csrftoken'
FORCE_SCRIPT_NAME
None
CACHE_BACKEND
'locmem://'
COMPRESS_CSSTIDY_BINARY
'csstidy'
USE_X_FORWARDED_HOST
False
SESSION_COOKIE_SECURE
False
COMPRESS_DEBUG_TOGGLE
'None'
CACHE_MIDDLEWARE_KEY_PREFIX
u'
****************'
COMPRESS_VERBOSE
False
CSRF_COOKIE_DOMAIN
None
FILE_CHARSET
'utf-8'
DEBUG
True
SESSION_FILE_PATH
None
COMPRESS_JS_FILTERS
['compressor.filters.jsmin.JSMinFilter']
DEFAULT_FILE_STORAGE
'django.core.files.storage.FileSystemStorage'
INSTALLED_APPS
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.markup',
'sorl.thumbnail',
'compressor',
'accounts',
'extensions',
'text',
'reel',
'resume',
'storify',
'webapps',
'seo',
'editor',
'designer',
'debug_toolbar')
LANGUAGES_BIDI
('he', 'ar', 'fa')
COMMENTS_ALLOW_PROFANITIES
False
COMPRESS_YUI_CSS_ARGUMENTS
''
STATICFILES_DIRS
()
PREPEND_WWW
False
SECURE_PROXY_SSL_HEADER
None
SESSION_COOKIE_HTTPONLY
True
DEBUG_PROPAGATE_EXCEPTIONS
False
MONTH_DAY_FORMAT
'F j'
LOGIN_URL
'/accounts/login/'
SESSION_EXPIRE_AT_BROWSER_CLOSE
False
TIME_FORMAT
'P'
COMPRESS_STORAGE
'compressor.storage.CompressorFileStorage'
DATE_INPUT_FORMATS
('%Y-%m-%d',
'%m/%d/%Y',
'%m/%d/%y',
'%b %d %Y',
'%b %d, %Y',
'%d %b %Y',
'%d %b, %Y',
'%B %d %Y',
'%B %d, %Y',
'%d %B %Y',
'%d %B, %Y')
COMPRESS_CSS_FILTERS
['compressor.filters.css_default.CssAbsoluteFilter']
AUTHENTICATION_BACKENDS
('django.contrib.auth.backends.ModelBackend',)
EMAIL_HOST_PASSWORD
u'****************'
COMPRESS_REBUILD_TIMEOUT
2592000
PASSWORD_RESET_TIMEOUT_DAYS
u'
****************'
CACHE_MIDDLEWARE_ALIAS
'default'
SESSION_SAVE_EVERY_REQUEST
False
ADMIN_MEDIA_PREFIX
'/admin/media/'
NUMBER_GROUPING
0
SESSION_ENGINE
'django.contrib.sessions.backends.db'
CSRF_FAILURE_VIEW
'django.views.csrf.csrf_failure'
CSRF_COOKIE_PATH
'/'
COMPRESS_CACHE_KEY_FUNCTION
u'****************'
LOGIN_REDIRECT_URL
'/accounts/profile/'
PROJECT_ROOT
'C:/Users/Jason/dev/portfolios/'
BASE_MEDIA_URL
'/media/'
DECIMAL_SEPARATOR
'.'
COMPRESS_PRECOMPILERS
(('text/less',
'C:/Users/Jason/dev/portfolios/bin/less.js-windows/lessc {infile} {outfile} -compress'),)
COMPRESS_MTIME_DELAY
10
SITE_ID
0
LOCALE_PATHS
()
SITE
'portfolios'
TEMPLATE_STRING_IF_INVALID
''
LOGOUT_URL
'/accounts/logout/'
EMAIL_USE_TLS
True
TEMPLATE_DIRS
('C:/Users/Jason/dev/portfolios/apps',
'C:/Users/Jason/dev/portfolios/templates',
u'C:/Users/Jason/dev/portfolios/templates/whatisjasongoldstein')
FIXTURE_DIRS
()
EMAIL_HOST
'smtp.gmail.com'
DATE_FORMAT
'N j, Y'
MEDIA_ROOT
'C:/Users/Jason/dev/portfolios/media/'
DEFAULT_EXCEPTION_REPORTER_FILTER
'django.views.debug.SafeExceptionReporterFilter'
ADMINS
(('Jason Goldstein', '[email protected]'),)
FORMAT_MODULE_PATH
None
DEFAULT_FROM_EMAIL
'[email protected]'
COMPRESS_ROOT
'c:\users\jason\dev\portfolios\static'
MEDIA_URL
'/media/'
DATETIME_FORMAT
'N j, Y, P'
COMPRESS_YUI_JS_ARGUMENTS
''
COMPRESS_JS_COMPRESSOR
'compressor.js.JsCompressor'
DISALLOWED_USER_AGENTS
()
ALLOWED_INCLUDE_ROOTS
()
COMPRESS_MINT_DELAY
30
LOGGING
{'disable_existing_loggers': False,
'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}},
'handlers': {'mail_admins': {'class': 'django.utils.log.AdminEmailHandler',
'filters': ['require_debug_false'],
'level': 'ERROR'}},
'loggers': {'django.request': {'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True}},
'version': 1}
SHORT_DATE_FORMAT
'm/d/Y'
TEST_RUNNER
'django.test.simple.DjangoTestSuiteRunner'
COMPRESS_ENABLED
True
IGNORABLE_404_URLS
()
COMPRESS_OFFLINE
False
TIME_ZONE
'America/Chicago'
FILE_UPLOAD_MAX_MEMORY_SIZE
2621440
EMAIL_BACKEND
'django.core.mail.backends.smtp.EmailBackend'
DEFAULT_TABLESPACE
''
TEMPLATE_CONTEXT_PROCESSORS
('django.contrib.auth.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.static',
'django.core.context_processors.tz',
'django.contrib.messages.context_processors.messages',
'django.core.context_processors.request')
SESSION_COOKIE_AGE
1209600
SETTINGS_MODULE
'portfolios.settings'
USE_ETAGS
False
LANGUAGES
(('ar', 'Arabic'),
('az', 'Azerbaijani'),
('bg', 'Bulgarian'),
('bn', 'Bengali'),
('bs', 'Bosnian'),
('ca', 'Catalan'),
('cs', 'Czech'),
('cy', 'Welsh'),
('da', 'Danish'),
('de', 'German'),
('el', 'Greek'),
('en', 'English'),
('en-gb', 'British English'),
('eo', 'Esperanto'),
('es', 'Spanish'),
('es-ar', 'Argentinian Spanish'),
('es-mx', 'Mexican Spanish'),
('es-ni', 'Nicaraguan Spanish'),
('et', 'Estonian'),
('eu', 'Basque'),
('fa', 'Persian'),
('fi', 'Finnish'),
('fr', 'French'),
('fy-nl', 'Frisian'),
('ga', 'Irish'),
('gl', 'Galician'),
('he', 'Hebrew'),
('hi', 'Hindi'),
('hr', 'Croatian'),
('hu', 'Hungarian'),
('id', 'Indonesian'),
('is', 'Icelandic'),
('it', 'Italian'),
('ja', 'Japanese'),
('ka', 'Georgian'),
('kk', 'Kazakh'),
('km', 'Khmer'),
('kn', 'Kannada'),
('ko', 'Korean'),
('lt', 'Lithuanian'),
('lv', 'Latvian'),
('mk', 'Macedonian'),
('ml', 'Malayalam'),
('mn', 'Mongolian'),
('nb', 'Norwegian Bokmal'),
('ne', 'Nepali'),
('nl', 'Dutch'),
('nn', 'Norwegian Nynorsk'),
('pa', 'Punjabi'),
('pl', 'Polish'),
('pt', 'Portuguese'),
('pt-br', 'Brazilian Portuguese'),
('ro', 'Romanian'),
('ru', 'Russian'),
('sk', 'Slovak'),
('sl', 'Slovenian'),
('sq', 'Albanian'),
('sr', 'Serbian'),
('sr-latn', 'Serbian Latin'),
('sv', 'Swedish'),
('sw', 'Swahili'),
('ta', 'Tamil'),
('te', 'Telugu'),
('th', 'Thai'),
('tr', 'Turkish'),
('tt', 'Tatar'),
('uk', 'Ukrainian'),
('ur', 'Urdu'),
('vi', 'Vietnamese'),
('zh-cn', 'Simplified Chinese'),
('zh-tw', 'Traditional Chinese'))
COMPRESS_CLOSURE_COMPILER_BINARY
'java -jar compiler.jar'
FILE_UPLOAD_TEMP_DIR
None
INTERNAL_IPS
('127.0.0.1',)
STATIC_URL
'/static/'
EMAIL_PORT
587
USE_TZ
False
SHORT_DATETIME_FORMAT
'm/d/Y P'
PASSWORD_HASHERS
u'
****************'
ABSOLUTE_URL_OVERRIDES
{}
CACHE_MIDDLEWARE_SECONDS
600
DEBUG_TOOLBAR_CONFIG
{'HIDE_DJANGO_SQL': True, 'INTERCEPT_REDIRECTS': False}
DATETIME_INPUT_FORMATS
('%Y-%m-%d %H:%M:%S',
'%Y-%m-%d %H:%M:%S.%f',
'%Y-%m-%d %H:%M',
'%Y-%m-%d',
'%m/%d/%Y %H:%M:%S',
'%m/%d/%Y %H:%M:%S.%f',
'%m/%d/%Y %H:%M',
'%m/%d/%Y',
'%m/%d/%y %H:%M:%S',
'%m/%d/%y %H:%M:%S.%f',
'%m/%d/%y %H:%M',
'%m/%d/%y')
EMAIL_HOST_USER
'[email protected]'
PROFANITIES_LIST
u'_***************'
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 500 page.
«

Node.js, NPM and lessc now work on Windows

Hey Duncan,
I recently found out that Node.js, Node Package Manager and lessc now work on Windows. Installing and using LESS this way is very easy. I updated the less.js Github page about command line LESS tools with this information.
When I have more time I will update WinLess to work with lessc instead of your (awesome) script.

Maybe you should update your blog post and the readme of this project to reflect this change?

Cheers,

Mark

Output is empty file

Perhaps I have too many files or too large files but it says "FATAL ERROR: CALL_AND_RETRY_2 Allocation failed - process out of memory" ... the node.js stops around 750K memory, system has 12 Gig of memory.
How can I allocate more memory?

File Watcher

How would I go about setting this up to watch less files for changes and then save out a compressed css file?

IE hacks problem

Hello

I have a problem with IE hacks with arguments

Example:
@radius: 20px;

.test {
border-radius: @radius \9; //throw error
border-radius: 20px \9; //everything is ok
}

When an '@import'-ed file is empty, further '@imports' are not processed

I have tested this with the newest version of your script + version 1.1.4 of less.js.

main.less:

@import "imports/import1";
@import "imports/import2";

imports/import1.less : empty
imports/import2.less:

.import2{
    height: 55px;
}

No errors are thrown, but the output file test.css is empty. If a comment is added to import1.less (either a css comment or a less comment) import2.less does get proccessed.

Upgrade request: Less 1.5.0

Any plan on upgrading to LESS 1.5.0 in near future ? Sourcemap support is a great and much needed feature (at least for me)

Update request: 2.1.1

Hello! I'm working sometimes on my school computer in which I cannot install anything, your package helps me a lot however being stuck on 1.7.5 which is rather old now doesn't suit my needs (I use partial files which do get compiled with your 1.7.5 package)

Thanks!

LESS-1.3.0

Trying to compile a .LESS file that was working with LESS-1.2.2 with LESS-1.3.0 and I now get the following error:

ERROR:
type: Syntax
message: 'eval' is null or not an object
filename: ..\app\vendors\bootstrap\less\bootstrap.less
column: -1
extract: ,, * Bootstrap v2.0.2

It's working fine if I use LESS-1.3.0 directly in my html file, so I know the .LESS file has no error. Could this be related to the way the .swf file calls less?

Thankx

Runtime error with empty files

If I want to compile an empty file, I got the following error "lessc.wsf(22, 14) runtime error microsoft jscript: Input past end of file"

problem with @import

import works fine with .css files, but it fails when using .less files via lessc.wsf and XMLHttpRequest.prototype

@import url(test.less);

@color: #4D926F;

header {

color: @color;
}
h2 {
color: @color;
}

Machine friendly error output format

It would be nice to have an ability to have information about errors in machine friendly output format.

It would be ideal to have all information about a problem within only one line so a program could easily parse whole output line by line.

For example it is done in Dart. There is a --format:machine flag for that purposes.

新需求

我希望less可以变成成紧凑型的代码,如:

nav ul{margin:0;padding:0;list-style:none}
nav li{display:inline-block}
nav a{display:block;padding:6px 12px;text-decoration:none}

@import (inline) doesn't work

Hy,

i used @import (inline) for a css-file, that i want to include in my code.
But less.js-windows give me this error:

SyntaxError: expected ')' got 'i' in file.less on line 2, column 10:
1
2 @import (inline) 'file.css';
3

is there any workaround?

Docs are wrong & this is broken

I can't get this to work at all. I just receive errors and the docs don't include anything to help.

First, running the command lessc with any options causes this error after initial download:

'"C:\less.js-windows\bin\node.exe"' is not recognized as an internal or external
command, operable program or batch file.

If I run the build script included with this I receive errors:

Downloading latest node.exe
Install/update less ...
'npm' is not recognized as an internal or external command,
operable program or batch file.
Flatenning node_modules
INFO: Could not find files for the given pattern(s).
'npm' is not recognized as an internal or external command,
operable program or batch file.
'flatten-packages' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
Cleaning node_modules
module.js:338
throw err;
^
Error: Cannot find module 'c:\less.js-windows\bin\node_modules\less\bin\lessc'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
Creating "c:\less.js-windows\less.js-windows-v.zip"

Repeating my styles 5 times

I’m using the less-1.3.0.js to compile my main.less file, but the result is strange and i’m not figuring out how to fix this problem.

The problem is that the content of my main file is repeating 5 times, when compiles it does the imports of the files ok.
For example:

@import “less/bootstrap.less”; //add the compiled content OK

all my styles here // repeates 5 times

——-
I done some tests like. My file have 435 lines and repeats 5 times my styles, with 434 lines it works ok.
There is some characters/size/lines limitation for the compiler?

wsf folder compile issue

I'm getting the following error when I try to compile a folder:
lessc.wsf(107, 27) Microsoft JScript runtime error: 'e' is null or not an object

folder contains some *.less files,
files are compressed: sometimes all of them, sometimes all except the last one.
all files are valid and contain no errors and I can compile them all separately with no issues.

I've tried to debug the lessc.wsf file and it seems that when enumerating files in some cases "e" becames null which breaks the script...

I couldn't figure out why.

can not convert less functions for strings

i have a less file with some less functions,but i suffered error report when i save my less file.

for test:
body{ %("repetitions: %a file: %d", 1 + 2, "directory/file.less"); }

it report:

ParseError : unrecognised input error in ......

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.