Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[ios, macos] Update cross-refs to properties in doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
1ec5 committed Jan 6, 2018
1 parent 8c61854 commit a0cb1f2
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 21 deletions.
10 changes: 6 additions & 4 deletions platform/darwin/scripts/generate-style-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ _.forOwn(cocoaConventions, function (properties, kind) {
delete spec[kind][oldName];
spec[kind][newName] = property;

// Update requirements in other properties.
let updateRequirements = function (property, name) {
// Update cross-references to this property in other properties'
// documentation and requirements.
let renameCrossReferences = function (property, name) {
property.doc = property.doc.replace(new RegExp('`' + oldName + '`', 'g'), '`' + newName + '`');
let requires = property.requires || [];
for (let i = 0; i < requires.length; i++) {
if (requires[i] === oldName) {
Expand All @@ -45,8 +47,8 @@ _.forOwn(cocoaConventions, function (properties, kind) {
}
}
};
_.forOwn(spec[kind.replace(/^layout_/, 'paint_')], updateRequirements);
_.forOwn(spec[kind.replace(/^paint_/, 'layout_')], updateRequirements);
_.forOwn(spec[kind.replace(/^layout_/, 'paint_')], renameCrossReferences);
_.forOwn(spec[kind.replace(/^paint_/, 'layout_')], renameCrossReferences);
})
});

Expand Down
4 changes: 2 additions & 2 deletions platform/darwin/src/MGLCircleStyleLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ typedef NS_ENUM(NSUInteger, MGLCircleScaleAlignment) {
};

/**
Controls the frame of reference for `circleTranslate`.
Controls the frame of reference for `circleTranslation`.
Values of this type are used in the `MGLCircleStyleLayer.circleTranslationAnchor`
property.
Expand Down Expand Up @@ -489,7 +489,7 @@ MGL_EXPORT
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *circleTranslate __attribute__((unavailable("Use circleTranslation instead.")));

/**
Controls the frame of reference for `circleTranslate`.
Controls the frame of reference for `circleTranslation`.
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLCircleTranslationAnchorMap`. Set this property
Expand Down
4 changes: 2 additions & 2 deletions platform/darwin/src/MGLFillExtrusionStyleLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
NS_ASSUME_NONNULL_BEGIN

/**
Controls the frame of reference for `fillExtrusionTranslate`.
Controls the frame of reference for `fillExtrusionTranslation`.
Values of this type are used in the `MGLFillExtrusionStyleLayer.fillExtrusionTranslationAnchor`
property.
Expand Down Expand Up @@ -313,7 +313,7 @@ MGL_EXPORT
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *fillExtrusionTranslate __attribute__((unavailable("Use fillExtrusionTranslation instead.")));

/**
Controls the frame of reference for `fillExtrusionTranslate`.
Controls the frame of reference for `fillExtrusionTranslation`.
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLFillExtrusionTranslationAnchorMap`. Set this
Expand Down
4 changes: 2 additions & 2 deletions platform/darwin/src/MGLFillStyleLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
NS_ASSUME_NONNULL_BEGIN

/**
Controls the frame of reference for `fillTranslate`.
Controls the frame of reference for `fillTranslation`.
Values of this type are used in the `MGLFillStyleLayer.fillTranslationAnchor`
property.
Expand Down Expand Up @@ -322,7 +322,7 @@ MGL_EXPORT
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *fillTranslate __attribute__((unavailable("Use fillTranslation instead.")));

/**
Controls the frame of reference for `fillTranslate`.
Controls the frame of reference for `fillTranslation`.
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLFillTranslationAnchorMap`. Set this property to
Expand Down
4 changes: 2 additions & 2 deletions platform/darwin/src/MGLLineStyleLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ typedef NS_ENUM(NSUInteger, MGLLineJoin) {
};

/**
Controls the frame of reference for `lineTranslate`.
Controls the frame of reference for `lineTranslation`.
Values of this type are used in the `MGLLineStyleLayer.lineTranslationAnchor`
property.
Expand Down Expand Up @@ -515,7 +515,7 @@ MGL_EXPORT
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *lineTranslate __attribute__((unavailable("Use lineTranslation instead.")));

/**
Controls the frame of reference for `lineTranslate`.
Controls the frame of reference for `lineTranslation`.
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLLineTranslationAnchorMap`. Set this property to
Expand Down
18 changes: 9 additions & 9 deletions platform/darwin/src/MGLSymbolStyleLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ typedef NS_ENUM(NSUInteger, MGLTextTransform) {
};

/**
Controls the frame of reference for `iconTranslate`.
Controls the frame of reference for `iconTranslation`.
Values of this type are used in the `MGLSymbolStyleLayer.iconTranslationAnchor`
property.
Expand All @@ -298,7 +298,7 @@ typedef NS_ENUM(NSUInteger, MGLIconTranslationAnchor) {
};

/**
Controls the frame of reference for `textTranslate`.
Controls the frame of reference for `textTranslation`.
Values of this type are used in the `MGLSymbolStyleLayer.textTranslationAnchor`
property.
Expand Down Expand Up @@ -445,8 +445,8 @@ MGL_EXPORT
/**
Name of image in sprite to use for drawing an image background. A string with
`{tokens}` replaced, referencing the data property to pull from. (`{token}`
replacement is only supported for literal `iconImage` values; not for property
functions.)
replacement is only supported for literal `iconImageName` values; not for
property functions.)
This attribute corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-icon-image"><code>icon-image</code></a>
Expand Down Expand Up @@ -656,8 +656,8 @@ MGL_EXPORT

/**
Scales the original size of the icon by the provided factor. The new point size
of the image will be the original point size multiplied by `iconSize`. 1 is the
original size; 3 triples the size of the image.
of the image will be the original point size multiplied by `iconScale`. 1 is
the original size; 3 triples the size of the image.
This property is measured in factor of the original icon sizes.
Expand Down Expand Up @@ -947,7 +947,7 @@ MGL_EXPORT
/**
Value to use for a text label. Feature properties are specified using tokens
like `{field_name}`. (`{token}` replacement is only supported for literal
`textField` values; not for property functions.)
`text` values; not for property functions.)
The default value of this property is an `MGLStyleValue` object containing the
empty string. Set this property to `nil` to reset it to the default value.
Expand Down Expand Up @@ -1736,7 +1736,7 @@ MGL_EXPORT
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconTranslate __attribute__((unavailable("Use iconTranslation instead.")));

/**
Controls the frame of reference for `iconTranslate`.
Controls the frame of reference for `iconTranslation`.
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLIconTranslationAnchorMap`. Set this property to
Expand Down Expand Up @@ -2061,7 +2061,7 @@ MGL_EXPORT
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *textTranslate __attribute__((unavailable("Use textTranslation instead.")));

/**
Controls the frame of reference for `textTranslate`.
Controls the frame of reference for `textTranslation`.
The default value of this property is an `MGLStyleValue` object containing an
`NSValue` object containing `MGLTextTranslationAnchorMap`. Set this property to
Expand Down

0 comments on commit a0cb1f2

Please sign in to comment.