aglio-theme-olio
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -0,1 +1,8 @@ | ||
# 0.0.9 - 2015-07-14 | ||
* Compliance with spec on parameter rendering. [#58](https://github.com/danielgtaylor/aglio/issues/58) | ||
* Minor theme color tweaks. | ||
* Make it possible to easily override padding and fonts. | ||
* Fix minor styling issue on Internet Explorer 11. | ||
# 0.0.8 - 2015-07-13 | ||
@@ -2,0 +9,0 @@ |
// Generated by CoffeeScript 1.9.2 | ||
(function() { | ||
var ROOT, benchmark, cache, crypto, decorate, fs, getCached, getCss, getTemplate, highlight, hljs, jade, less, markdownIt, moment, path, querystring, slug; | ||
var ROOT, benchmark, cache, crypto, decorate, fs, getCached, getCss, getTemplate, highlight, hljs, jade, less, markdownIt, modifyUriTemplate, moment, path, querystring, slug; | ||
@@ -221,4 +221,62 @@ crypto = require('crypto'); | ||
modifyUriTemplate = function(templateUri, parameters) { | ||
var block, closeIndex, index, lastIndex, param, parameterBlocks, parameterSet, parameterValidator; | ||
parameterValidator = function(b) { | ||
return parameters.indexOf(b) !== -1; | ||
}; | ||
parameters = (function() { | ||
var i, len, results; | ||
results = []; | ||
for (i = 0, len = parameters.length; i < len; i++) { | ||
param = parameters[i]; | ||
results.push(param.name); | ||
} | ||
return results; | ||
})(); | ||
parameterBlocks = []; | ||
lastIndex = index = 0; | ||
while ((index = templateUri.indexOf("{", index)) !== -1) { | ||
parameterBlocks.push(templateUri.substring(lastIndex, index)); | ||
block = {}; | ||
closeIndex = templateUri.indexOf("}", index); | ||
block.querySet = templateUri.indexOf("{?", index) === index; | ||
block.formSet = templateUri.indexOf("{&", index) === index; | ||
block.reservedSet = templateUri.indexOf("{+", index) === index; | ||
lastIndex = closeIndex + 1; | ||
index++; | ||
if (block.querySet) { | ||
index++; | ||
} | ||
parameterSet = templateUri.substring(index, closeIndex); | ||
block.parameters = parameterSet.split(",").filter(parameterValidator); | ||
if (block.parameters.length) { | ||
parameterBlocks.push(block); | ||
} | ||
} | ||
parameterBlocks.push(templateUri.substring(lastIndex, templateUri.length)); | ||
return parameterBlocks.reduce(function(uri, v) { | ||
var segment; | ||
if (typeof v === "string") { | ||
uri.push(v); | ||
} else { | ||
segment = ["{"]; | ||
if (v.querySet) { | ||
segment.push("?"); | ||
} | ||
if (v.formSet) { | ||
segment.push("&"); | ||
} | ||
if (v.reservedSet) { | ||
segment.push("+"); | ||
} | ||
segment.push(v.parameters.join()); | ||
segment.push("}"); | ||
uri.push(segment.join("")); | ||
} | ||
return uri; | ||
}, []).join(''); | ||
}; | ||
decorate = function(api, md, slugCache) { | ||
var action, err, example, i, item, len, name, ref, resource, resourceGroup, results, slugify; | ||
var action, err, example, i, item, knownParams, len, name, newParams, param, ref, resource, resourceGroup, results, reversed, slugify; | ||
slugify = slug.bind(slug, slugCache); | ||
@@ -250,3 +308,3 @@ if (api.description) { | ||
results1.push((function() { | ||
var k, len2, ref2, results2; | ||
var k, l, len2, len3, ref2, results2; | ||
ref2 = resource.actions || []; | ||
@@ -261,21 +319,36 @@ results2 = []; | ||
action.parameters = resource.parameters; | ||
} else if (resource.parameters) { | ||
action.parameters = resource.parameters.concat(action.parameters); | ||
} | ||
knownParams = {}; | ||
newParams = []; | ||
reversed = (action.parameters || []).concat([]).reverse(); | ||
for (l = 0, len3 = reversed.length; l < len3; l++) { | ||
param = reversed[l]; | ||
if (knownParams[param.name]) { | ||
continue; | ||
} | ||
knownParams[param.name] = true; | ||
newParams.push(param); | ||
} | ||
action.parameters = newParams.reverse(); | ||
action.uriTemplate = modifyUriTemplate((action.attributes || {}).uriTemplate || resource.uriTemplate || '', action.parameters); | ||
results2.push((function() { | ||
var l, len3, ref3, results3; | ||
var len4, m, ref3, results3; | ||
ref3 = action.examples || []; | ||
results3 = []; | ||
for (l = 0, len3 = ref3.length; l < len3; l++) { | ||
example = ref3[l]; | ||
for (m = 0, len4 = ref3.length; m < len4; m++) { | ||
example = ref3[m]; | ||
results3.push((function() { | ||
var len4, m, ref4, results4; | ||
var len5, n, ref4, results4; | ||
ref4 = ['requests', 'responses']; | ||
results4 = []; | ||
for (m = 0, len4 = ref4.length; m < len4; m++) { | ||
name = ref4[m]; | ||
for (n = 0, len5 = ref4.length; n < len5; n++) { | ||
name = ref4[n]; | ||
results4.push((function() { | ||
var len5, n, ref5, results5; | ||
var len6, o, ref5, results5; | ||
ref5 = example[name] || []; | ||
results5 = []; | ||
for (n = 0, len5 = ref5.length; n < len5; n++) { | ||
item = ref5[n]; | ||
for (o = 0, len6 = ref5.length; o < len6; o++) { | ||
item = ref5[o]; | ||
item.hasContent = item.description || Object.keys(item.headers).length || item.body || item.schema; | ||
@@ -282,0 +355,0 @@ try { |
{ | ||
"name": "aglio-theme-olio", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "Default theme for the Aglio API Blueprint renderer", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66703
656