From 4f13aabb6c36e6f97c5fb9dc2c720a082c3225c5 Mon Sep 17 00:00:00 2001 From: Paul Norman Date: Fri, 23 Jan 2015 00:43:48 -0800 Subject: [PATCH 1/2] Update less link Update Less page link to match the current layout (cherry picked from commit 73e6726e089ff47fae5115183aa3776918946ab7) --- docs-generator/index._ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-generator/index._ b/docs-generator/index._ index 3c26904..8c85054 100644 --- a/docs-generator/index._ +++ b/docs-generator/index._ @@ -23,7 +23,7 @@ line-color: yellow; } ``` -Especially of note is the support for hsl, which can be [easier to reason about than rgb()](http://mothereffinghsl.com/). Carto also includes several color functions [borrowed from less](http://lesscss.org/#-color-functions): +Especially of note is the support for hsl, which can be [easier to reason about than rgb()](http://mothereffinghsl.com/). Carto also includes several color operation functions [borrowed from less](http://lesscss.org/functions/#color-operations): ``` css // lighten and darken colors From 1612b5a8b7cf888d75ccf3e79e84960799ad3848 Mon Sep 17 00:00:00 2001 From: Young Hahn Date: Sat, 2 Aug 2014 17:40:54 -0400 Subject: [PATCH 2/2] Drop xml2js and thus mml2json. (cherry picked from commit bde0d0e2abfeb046a87edc0df5a7948362b9e2c8) --- bin/mml2json.js | 69 ------------------------------------------------- 1 file changed, 69 deletions(-) delete mode 100755 bin/mml2json.js diff --git a/bin/mml2json.js b/bin/mml2json.js deleted file mode 100755 index 24afcdd..0000000 --- a/bin/mml2json.js +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env node - -var xml2js = require('xml2js'), - fs = require('fs'); - -if (!process.argv[2]) { - console.log('Please specify a XML file.'); - process.exit(1); -} - -fs.readFile(process.argv[2], 'utf-8', function(err, data) { - if (err) throw err; - - // Replace entities. - var entities = {}; - var match = data.match(/]|"([^"]|\\")*")+>/g) - if (match != null) { - match.forEach(function(entity) { - var parts = entity.match(/^$/); - entities['&' + parts[1] + ';'] = parts[2]; - }); - } - data = data.replace(/&\w+;/g, function(entity) { - return entities[entity]; - }); - - function addAttributes(obj) { - if (obj['$']) for (var key in obj['$']) obj[key] = obj['$'][key]; - delete obj['$']; - return obj; - } - - function simplifyExternal(obj) { - if (obj.src) return obj.src; - else return obj; - } - - var parser = new xml2js.Parser({ - explicitRoot: false, - explicitArray: false - }); - parser.addListener('end', function(json) { - console.log(JSON.stringify(json, function(key, value) { - if (!key) { - return addAttributes(value); - } - else if (key === 'Stylesheet') { - if (Array.isArray(value)) return value.map(addAttributes).map(simplifyExternal); - else return [ simplifyExternal(addAttributes(value)) ]; - } - else if (key === 'Layer' || key === 'Stylesheet') { - if (Array.isArray(value)) return value.map(addAttributes); - else return [ addAttributes(value) ]; - } - else if (key === 'Datasource') { - value = addAttributes(value); - value.Parameter.forEach(function(parameter) { - value[parameter['$'].name] = parameter['_']; - }); - delete value.Parameter; - return value; - } - else { - return value; - } - }, 4)); - }); - parser.parseString(data); -});