From a4fcea412239f6936ab0dd0d21abda912e22bd47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Thu, 18 Aug 2016 00:14:43 -0700 Subject: [PATCH] [ios, macos] Refer to attributes in kebab-case Fixes #5951. --- platform/darwin/scripts/generate-style-code.js | 10 ++++++++++ platform/darwin/src/MGLFillStyleLayer.h | 2 +- platform/darwin/src/MGLStyleLayer.h.ejs | 4 ++-- platform/darwin/src/MGLSymbolStyleLayer.h | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js index dd634fd69..77c1ee5a1 100644 --- a/platform/darwin/scripts/generate-style-code.js +++ b/platform/darwin/scripts/generate-style-code.js @@ -87,6 +87,16 @@ global.testArrayImplementation = function (property) { } }; +global.propertyDoc = function (property, layerType) { + let doc = property.doc.replace(/`(.+?)`/g, function (m, symbol, offset, str) { + if (!('values' in property && property.values.indexOf(symbol) !== -1) && str.substr(offset - 4, 3) !== 'CSS') { + symbol = camelizeWithLeadingLowercase(symbol); + } + return '`' + symbol + '`'; + }); + return doc; +}; + global.propertyType = function (property, _private) { return _private ? `id ` : `id `; }; diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h index de5369a33..c3e6d63d1 100644 --- a/platform/darwin/src/MGLFillStyleLayer.h +++ b/platform/darwin/src/MGLFillStyleLayer.h @@ -29,7 +29,7 @@ typedef NS_ENUM(NSUInteger, MGLFillStyleLayerFillTranslateAnchor) { @property (nonatomic) id fillColor; /** - The outline color of the fill. Matches the value of `fill-color` if unspecified. + The outline color of the fill. Matches the value of `fillColor` if unspecified. */ @property (nonatomic) id fillOutlineColor; diff --git a/platform/darwin/src/MGLStyleLayer.h.ejs b/platform/darwin/src/MGLStyleLayer.h.ejs index 4ef28469f..bf6721e41 100644 --- a/platform/darwin/src/MGLStyleLayer.h.ejs +++ b/platform/darwin/src/MGLStyleLayer.h.ejs @@ -36,7 +36,7 @@ typedef NS_ENUM(NSUInteger, MGL<%- camelize(type) %>StyleLayer<%- camelize(prope <% for (const property of layoutProperties) { -%> /** - <%- property.doc %> + <%- propertyDoc(property, type) %> */ @property (nonatomic) <%- propertyType(property, false, type) %> <%- camelizeWithLeadingLowercase(property.name) %>; @@ -46,7 +46,7 @@ typedef NS_ENUM(NSUInteger, MGL<%- camelize(type) %>StyleLayer<%- camelize(prope <% for (const property of paintProperties) { -%> /** - <%- property.doc %> + <%- propertyDoc(property, type) %> */ @property (nonatomic) <%- propertyType(property, false, type) %> <%- camelizeWithLeadingLowercase(property.name) %>; diff --git a/platform/darwin/src/MGLSymbolStyleLayer.h b/platform/darwin/src/MGLSymbolStyleLayer.h index 371107226..a4d6c2b5b 100644 --- a/platform/darwin/src/MGLSymbolStyleLayer.h +++ b/platform/darwin/src/MGLSymbolStyleLayer.h @@ -145,7 +145,7 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) { @property (nonatomic) id iconOffset; /** - Aligns text to the plane of the `viewport` or the `map` when the map is pitched. Matches `text-rotation-alignment` if unspecified. + Aligns text to the plane of the `viewport` or the `map` when the map is pitched. Matches `textRotationAlignment` if unspecified. */ @property (nonatomic) id textPitchAlignment;