Skip to content

Commit

Permalink
Unify naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Würthner committed May 29, 2024
1 parent 19747ea commit eadd588
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ This templating is used in the `filter` and `fileNames` configurations.

- `figma`: A `Figma` object
- `date`: The current date
- `fullName`: The full name of the component. If part of a component set, comprised of the name of
- `full_name`: The full name of the component. If part of a component set, comprised of the name of
the component set and the component name. The component name otherwise.
- `name`: The name of the component
- `key`: The key of the component
- `id`: The id of the component
- `setName`: The name of the set of which this component is a part of, empty if not part of a set
- `setKey`: The ket of the set of which this component is a part of, empty if not part of a set
- `setId`: The id of the set of which this component is a part of, empty if not part of a set
- `set_name`: The name of the set of which this component is a part of, empty if not part of a set
- `set_key`: The ket of the set of which this component is a part of, empty if not part of a set
- `set_id`: The id of the set of which this component is a part of, empty if not part of a set
- `scale`: A scale object representing the current scale for the export

### Templating for values export
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ data class FigExComponent(

override fun toContext() = mapOf(
"name" to name,
"setName" to (setName ?: ""),
"fullName" to fullName,
"setKey" to (setKey ?: ""),
"set_name" to (setName ?: ""),
"full_name" to fullName,
"set_key" to (setKey ?: ""),
"key" to key,
"id" to id,
"setId" to (setId ?: ""),
"set_id" to (setId ?: ""),
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ data class FigExConfig(
val destinationPath: String,
val clearDestination: Boolean = false,
val filter: String = "true",
val fileNames: String = "{{ fullName }}",
val fileNames: String = "{{ full_name }}",
val format: FigExIconFormat,
val rasterScales: List<Scale>? = null,
val useAndroidRasterScales: Boolean = false,
Expand Down
12 changes: 6 additions & 6 deletions samples/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,25 @@
{
"type": "icons",
"format": "androidxml",
"filter": "{% if fullName|startsWith('icon-', true) %} true {% else %} false {% endif %}",
"fileNames" : "{{ fullName|replaceSpecialChars('_')|lowercase }}",
"filter": "{% if full_name|startsWith('icon-', true) %} true {% else %} false {% endif %}",
"fileNames" : "{{ full_name|replaceSpecialChars('_')|lowercase }}",
"destinationPath": "~/Downloads/icons",
"clearDestination": true
},
{
"type": "icons",
"format": "webp",
"filter": "{% if fullName|startsWith('icon-', true) %} true {% else %} false {% endif %}",
"fileNames": "test/{{ fullName|replaceSpecialChars('_')|lowercase }}",
"filter": "{% if full_name|startsWith('icon-', true) %} true {% else %} false {% endif %}",
"fileNames": "test/{{ full_name|replaceSpecialChars('_')|lowercase }}",
"destinationPath": "~/Downloads/iconspng",
"clearDestination": true,
"useAndroidRasterScales": true
},
{
"type": "icons",
"format": "png",
"filter": "{% if fullName|startsWith('icon-', true) %} true {% else %} false {% endif %}",
"fileNames": "{{ fullName|replaceSpecialChars('_')|lowercase }}",
"filter": "{% if full_name|startsWith('icon-', true) %} true {% else %} false {% endif %}",
"fileNames": "{{ full_name|replaceSpecialChars('_')|lowercase }}",
"destinationPath": "~/Downloads/iconspngcustom",
"clearDestination": true,
"rasterScales": [
Expand Down

0 comments on commit eadd588

Please sign in to comment.