update style generation code for new style spec enum values docs (#6508)
Documentation for enum values landed in mapbox/mapbox-gl-style-spec#510. This updates Android, iOS, and macOS documentation code gen scripts to capitalize on them.
This commit is contained in:
@@ -116,7 +116,7 @@ global.defaultValueJava = function(property) {
|
||||
case 'string':
|
||||
return '"' + property['default'] + '"';
|
||||
case 'enum':
|
||||
return snakeCaseUpper(property.name) + "_" + snakeCaseUpper(property.values[0]);
|
||||
return snakeCaseUpper(property.name) + "_" + snakeCaseUpper(Object.keys(property.values)[0]);
|
||||
case 'color':
|
||||
return '"rgba(0, 0, 0, 1)"';
|
||||
case 'array':
|
||||
@@ -137,8 +137,18 @@ global.defaultValueJava = function(property) {
|
||||
}
|
||||
}
|
||||
|
||||
global.propertyDoc = function (propertyName, property) {
|
||||
let doc = property.doc.replace(/`(.+?)`/g, function (m, symbol, offset, str) {
|
||||
if (str.substr(offset - 4, 3) !== 'CSS') {
|
||||
symbol = camelizeWithLeadingLowercase(symbol);
|
||||
}
|
||||
return '`' + symbol + '`';
|
||||
});
|
||||
return doc;
|
||||
};
|
||||
|
||||
//Process Layers
|
||||
const layers = spec.layer.type.values.map((type) => {
|
||||
const layers = Object.keys(spec.layer.type.values).map((type) => {
|
||||
const layoutProperties = Object.keys(spec[`layout_${type}`]).reduce((memo, name) => {
|
||||
if (name !== 'visibility') {
|
||||
spec[`layout_${type}`][name].name = name;
|
||||
|
||||
Reference in New Issue
Block a user