{"_id":"553d394e9660ba0d00569d12","githubsync":"","project":"543467200ef9c00800164ecc","version":{"_id":"553d394d9660ba0d00569d07","project":"543467200ef9c00800164ecc","forked_from":"54bedb2fffb79c320030db1f","__v":1,"createdAt":"2015-04-26T19:15:25.245Z","releaseDate":"2015-04-26T19:15:25.245Z","categories":["553d394d9660ba0d00569d08","553d394d9660ba0d00569d09"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"0.11.2","version":"0.11.2"},"__v":0,"category":{"_id":"553d394d9660ba0d00569d09","pages":["553d394e9660ba0d00569d0a","553d394e9660ba0d00569d0b","553d394e9660ba0d00569d0c","553d394e9660ba0d00569d0d","553d394e9660ba0d00569d0e","553d394e9660ba0d00569d0f","553d394e9660ba0d00569d10","553d394e9660ba0d00569d11","553d394e9660ba0d00569d12"],"project":"543467200ef9c00800164ecc","__v":1,"version":"553d394d9660ba0d00569d07","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-15T18:17:35.811Z","from_sync":false,"order":1,"slug":"extensions","title":"EXTENSIONS"},"user":"543466ea0e8e2b0e00341818","metadata":{"title":"","description":"","image":[]},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-01-25T16:33:48.582Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":10,"body":"less is an extension for glim framework to compile less files during the web server start. It uses less npm module to compile less source from command line.\n\n# Installation\n- install less from npm\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"npm install -g less\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n# Configuration\n- Add the following config to the extensions config;\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# app/config/<env>.py\\nconfig = {\\n\\t'extensions' : {\\n  \\t'less': {\\n    \\t'source': os.path.join(paths.APP_PATH, 'assets/less/app.less'),\\n      'destination': os.path.join(paths.APP_PATH, 'assets/css/app.css'),\\n      'options': [\\n        'compress',\\n        'lint',\\n        'nojs',\\n        'units'\\n      ]\\n    }\\n  },\\n\\t# ...\\n}\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n- The default configuration is the following;\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"DEFAULT_CONFIG = {\\n    'source': os.path.join(paths.APP_PATH, 'assets/less/main.less'),\\n    'destination': os.path.join(paths.APP_PATH, 'assets/css/main.css'),\\n    'options': [\\n        'lint',\\n        'units',\\n        'verbose'\\n    ]\\n}\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n# Usage\n- put a main.less file and add some styles\n- add main.css import to your html sources\n- start the web server\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<html>\\n    <head>\\n      <link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"/assets/css/main.css\\\">\\n    </head>\\n</html>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\n# Roadmap\n- Autocompile after file changes without web server start\n- Show less errors on werkzeug served page","excerpt":"less css extension for glim framework","slug":"less","type":"basic","title":"Less"}

Less

less css extension for glim framework

less is an extension for glim framework to compile less files during the web server start. It uses less npm module to compile less source from command line. # Installation - install less from npm [block:code] { "codes": [ { "code": "npm install -g less", "language": "shell" } ] } [/block] # Configuration - Add the following config to the extensions config; [block:code] { "codes": [ { "code": "# app/config/<env>.py\nconfig = {\n\t'extensions' : {\n \t'less': {\n \t'source': os.path.join(paths.APP_PATH, 'assets/less/app.less'),\n 'destination': os.path.join(paths.APP_PATH, 'assets/css/app.css'),\n 'options': [\n 'compress',\n 'lint',\n 'nojs',\n 'units'\n ]\n }\n },\n\t# ...\n}", "language": "python" } ] } [/block] - The default configuration is the following; [block:code] { "codes": [ { "code": "DEFAULT_CONFIG = {\n 'source': os.path.join(paths.APP_PATH, 'assets/less/main.less'),\n 'destination': os.path.join(paths.APP_PATH, 'assets/css/main.css'),\n 'options': [\n 'lint',\n 'units',\n 'verbose'\n ]\n}", "language": "python" } ] } [/block] # Usage - put a main.less file and add some styles - add main.css import to your html sources - start the web server [block:code] { "codes": [ { "code": "<html>\n <head>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"/assets/css/main.css\">\n </head>\n</html>", "language": "html" } ] } [/block] # Roadmap - Autocompile after file changes without web server start - Show less errors on werkzeug served page