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

Commit

Permalink
better format symbols in Android enum property docs
Browse files Browse the repository at this point in the history
  • Loading branch information
incanus committed Sep 29, 2016
1 parent e08bc5a commit 1325127
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static Property<Function<Boolean>> fillAntialias(Function<Boolean> functi
}

/**
* The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.
* The opacity of the entire fill layer. In contrast to the `fillColor`, this value will also affect the 1px stroke around the fill, if the stroke is used.
*
* @param value a Float value
* @return property wrapper around Float
Expand All @@ -62,7 +62,7 @@ public static Property<Float> fillOpacity(Float value) {
}

/**
* The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.
* The opacity of the entire fill layer. In contrast to the `fillColor`, this value will also affect the 1px stroke around the fill, if the stroke is used.
*
* @param function a wrapper function for Float
* @return property wrapper around a Float function
Expand Down Expand Up @@ -102,7 +102,7 @@ public static Property<Function<String>> fillColor(Function<String> function) {
}

/**
* 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.
*
* @param value a int color value
* @return property wrapper around String color
Expand All @@ -112,7 +112,7 @@ public static Property<String> fillOutlineColor(@ColorInt int value) {
}

/**
* 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.
*
* @param value a String value
* @return property wrapper around String
Expand All @@ -122,7 +122,7 @@ public static Property<String> fillOutlineColor(String value) {
}

/**
* 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.
*
* @param function a wrapper function for String
* @return property wrapper around a String function
Expand Down Expand Up @@ -1282,7 +1282,7 @@ public static Property<Function<Boolean>> iconOptional(Function<Boolean> functio
}

/**
* In combination with `symbol-placement`, determines the rotation behavior of icons.
* In combination with `symbolPlacement`, determines the rotation behavior of icons.
*
* @param value a String value
* @return property wrapper around String
Expand All @@ -1292,7 +1292,7 @@ public static Property<String> iconRotationAlignment(@Property.ICON_ROTATION_ALI
}

/**
* In combination with `symbol-placement`, determines the rotation behavior of icons.
* In combination with `symbolPlacement`, determines the rotation behavior of icons.
*
* @param function a wrapper function for String
* @return property wrapper around a String function
Expand Down Expand Up @@ -1342,7 +1342,7 @@ public static Property<Function<String>> iconTextFit(Function<String> function)
}

/**
* Size of the additional area added to dimensions determined by `icon-text-fix`, in clockwise order: top, right, bottom, left.
* Size of the additional area added to dimensions determined by `iconTextFix`, in clockwise order: top, right, bottom, left.
*
* @param value a Float[] value
* @return property wrapper around Float[]
Expand All @@ -1352,7 +1352,7 @@ public static Property<Float[]> iconTextFitPadding(Float[] value) {
}

/**
* Size of the additional area added to dimensions determined by `icon-text-fix`, in clockwise order: top, right, bottom, left.
* Size of the additional area added to dimensions determined by `iconTextFix`, in clockwise order: top, right, bottom, left.
*
* @param function a wrapper function for Float[]
* @return property wrapper around a Float[] function
Expand Down Expand Up @@ -1482,7 +1482,7 @@ public static Property<Function<String>> textPitchAlignment(Function<String> fun
}

/**
* In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.
* In combination with `symbolPlacement`, determines the rotation behavior of the individual glyphs forming the text.
*
* @param value a String value
* @return property wrapper around String
Expand All @@ -1492,7 +1492,7 @@ public static Property<String> textRotationAlignment(@Property.TEXT_ROTATION_ALI
}

/**
* In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.
* In combination with `symbolPlacement`, determines the rotation behavior of the individual glyphs forming the text.
*
* @param function a wrapper function for String
* @return property wrapper around a String function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class PropertyFactory {
<% for (const property of paintProperties) { -%>
<% if (property.type == 'color') { -%>
/**
* <%- property.doc %>
* <%- propertyDoc(property.name, property) %>
*
* @param value a int color value
* @return property wrapper around String color
Expand All @@ -49,7 +49,7 @@ public class PropertyFactory {
<% } -%>
/**
* <%- property.doc %>
* <%- propertyDoc(property.name, property) %>
*
* @param value a <%- propertyType(property) %> value
* @return property wrapper around <%- propertyType(property) %>
Expand All @@ -59,7 +59,7 @@ public class PropertyFactory {
}
/**
* <%- property.doc %>
* <%- propertyDoc(property.name, property) %>
*
* @param function a wrapper function for <%- propertyType(property) %>
* @return property wrapper around a <%- propertyType(property) %> function
Expand All @@ -71,7 +71,7 @@ public class PropertyFactory {
<% } -%>
<% for (const property of layoutProperties) { -%>
/**
* <%- property.doc %>
* <%- propertyDoc(property.name, property) %>
*
* @param value a <%- propertyType(property) %> value
* @return property wrapper around <%- propertyType(property) %>
Expand All @@ -81,7 +81,7 @@ public class PropertyFactory {
}
/**
* <%- property.doc %>
* <%- propertyDoc(property.name, property) %>
*
* @param function a wrapper function for <%- propertyType(property) %>
* @return property wrapper around a <%- propertyType(property) %> function
Expand Down
10 changes: 10 additions & 0 deletions platform/android/scripts/generate-style-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,16 @@ global.defaultValueJava = function(property) {
}
}

global.propertyDoc = function (propertyName, property) {
let doc = property.doc.replace(/`(.+?)`/g, function (m, symbol, offset, str) {
if (str.substr(offset - 4, 3) !== 'CSS') {
symbol = camelizeWithLeadingLowercase(symbol);
}
return '`' + symbol + '`';
});
return doc;
};

//Process Layers
const layers = Object.keys(spec.layer.type.values).map((type) => {
const layoutProperties = Object.keys(spec[`layout_${type}`]).reduce((memo, name) => {
Expand Down

0 comments on commit 1325127

Please sign in to comment.