[ios, macos] Refer to attributes in kebab-case

Fixes #5951.
This commit is contained in:
Minh Nguyễn
2016-08-18 00:14:43 -07:00
committed by Minh Nguyễn
parent aa03f0cab7
commit a4fcea4122
4 changed files with 14 additions and 4 deletions

View File

@@ -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 <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>` : `id <MGLStyleAttributeValue>`;
};

View File

@@ -29,7 +29,7 @@ typedef NS_ENUM(NSUInteger, MGLFillStyleLayerFillTranslateAnchor) {
@property (nonatomic) id <MGLStyleAttributeValue> 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 <MGLStyleAttributeValue> fillOutlineColor;

View File

@@ -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) %>;

View File

@@ -145,7 +145,7 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
@property (nonatomic) id <MGLStyleAttributeValue> 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 <MGLStyleAttributeValue> textPitchAlignment;