Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added onlyExportables option for images export #62

Merged
merged 3 commits into from May 9, 2020

Conversation

puchog
Copy link
Contributor

@puchog puchog commented Apr 23, 2020

onlyExportables option will allow the user to choose to fetch all components or only those marked as exportable on Figma.
This way the designer will get the option to create components for design purpose only, and components used on the handoff to iOS.

Fugen images config will be like the follow:

images:
  accessToken: 25961-4ac9fbc9-3bd8-4c43-bbe2-95e477f8a067
  file: https://www.figma.com/file/61xw2FQn61Xr7VVFYwiHHy/Fugen-Demo
  assets: Sources/Assets.xcassets/Images
  destination: Sources/Images.swift
  onlyExportables: true
  templateOptions:
    publicAccess: true

Fugen command line images will be like the follow:

Usage: fugen images [options]

Generates code for images from a Figma file.

Options:
  --accessToken <value>           A personal access token to make requests to the Figma API.
                                  Get more info: https://www.figma.com/developers/api#access-tokens
  --assets, -a <value>            Optional path to Xcode-assets folder to store images.
  --destination, -d <value>       The path to the file to generate.
                                  By default, generated code will be printed on stdout.
  --excludingNodes, -e <value>    A list of Figma nodes whose styles will be ignored.
                                  Can be repeated multiple times and must be in the format: -e "1:23".
  --fileKey <value>               Figma file key to generate images from.
  --fileVersion <value>           Figma file version ID to generate images from.
  --format, -r <value>            Optional image output format, can be 'pdf', 'png', 'jpg' or 'svg'.
                                  Defaults to 'pdf'.
  --includingNodes, -i <value>    A list of Figma nodes whose styles will be extracted.
                                  Can be repeated multiple times and must be in the format: -i "1:23".
                                  If omitted, all nodes will be included.
  --onlyExportables <value>       Indicates if it will fetch only exportable components, true or false
                                  By default false
  --options, -o <value>           An option that will be merged with template context, and overwrite any values of the same name.
                                  Can be repeated multiple times and must be in the format: -o "name:value".
  --resources, -r <value>         Optional path to Xcode-assets folder to store images.
  --template, -t <value>          Path to the template file.
                                  If no template is passed a default template will be used.
  -h, --help                      Show help information
  -scales, -s <value>             A comma separated list of integer image scaling factors.
                                  Each scaling factor should be between 1 and 3: -s "1,2,3".
                                  If omitted, images will be rendered with the original sizes.

Copy link
Owner

@almazrafi almazrafi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks for the PR!

@almazrafi almazrafi merged commit 9a28043 into almazrafi:master May 9, 2020
@puchog puchog deleted the feature/onlyExportables branch July 7, 2020 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants