diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2018-01-05 18:01:40 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2018-01-09 13:36:39 -0800 |
commit | 512117963e3be2d2a62329ff5c23cd964d6c88f9 (patch) | |
tree | c7380940acf6c9161fdd3718eeb8d9adcebc3a6a | |
parent | bb0a306158f4103a5de484d12cac75c920c2235f (diff) | |
download | qtlocation-mapboxgl-512117963e3be2d2a62329ff5c23cd964d6c88f9.tar.gz |
[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.
-rw-r--r-- | platform/darwin/scripts/generate-style-code.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js index ff3f02eefe..eb5d12d948 100644 --- a/platform/darwin/scripts/generate-style-code.js +++ b/platform/darwin/scripts/generate-style-code.js @@ -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)}` + '`'; |