[ios, macos] Qualify references to properties in enum docs

jazzy requires these property references to be qualified by class names in order to auto link them.
This commit is contained in:
Minh Nguyễn
2018-01-05 18:01:40 -08:00
committed by John Firebaugh
parent 834e9cda58
commit f8d5b2511c

View File

@@ -247,6 +247,13 @@ global.propertyDoc = function (propertyName, property, layerType, kind) {
// Format everything else: our property name & its possible values.
// Requires symbols to be surrounded by backticks.
doc = doc.replace(/`(.+?)`/g, function (m, symbol, offset, str) {
if (kind === 'enum') {
let layoutProperties = spec[`layout_${layerType}`] || [];
let paintProperties = spec[`paint_${layerType}`] || [];
if (symbol in layoutProperties || symbol in paintProperties) {
return '`MGL' + camelize(layerType) + 'StyleLayer.' + camelizeWithLeadingLowercase(symbol) + '`';
}
}
if ('values' in property && Object.keys(property.values).indexOf(symbol) !== -1) {
let objCType = global.objCType(layerType, property.name);
return '`' + `${objCType}${camelize(symbol)}` + '`';