Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Axadiw committed Jun 18, 2015
1 parent 6f69a54 commit f9047c7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
21 changes: 17 additions & 4 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ If you'd like to use different settings, you need to provide configuration file,

```
# Default xcasset dir
xcassets_dir: Resources/Images.xcassets
xcassets_dir: Assets.xcassets
# Where vector images are kept
raw_assets: Assets
raw_assets: VectorAssets
# Where generated PNG(s) will be kept
generated_assets_dir: GeneratedAssets
Expand All @@ -106,18 +106,31 @@ basset-ios -c "Assets/config.yml"
```
basset-ios [-h] [-d XCASSETS_DIR] [-a RAW_ASSETS_DIR]
[-g GENERATED_ASSETS_DIR] [-m MERGE_WITH_XCASSETS]
[-c CONFIG]
[-c CONFIG] [-e EXTRACT_PATH]
optional arguments:
arguments:
-h, --help show help message and exit
-x, --xcassets_dir XCASSETS_DIR path to directory with default xcassets directory
-r, --raw_assets_dir RAW_ASSETS_DIR path to directory with raw, vector based graphics
-g, --generated_assets_dir GENERATED_ASSETS_DIR path to directory where generated PNGs will be stored
-m, --merge_with_xcassets MERGE_WITH_XCASSETS will script process xcassets directories
-f, --force_convert FORCE_CONVERT should regenerate assets even when they were generated before
-c, --config CONFIG path to config file
-e, --extract_path EXTRACT_PATH if set to existing xcassets directory, will extract all assets from it to "raw_assets_dir"
```

## Extracting assets from existing .xcassets

In case you'd have existing project, with existing .xcassets with PDFs, you can extract them to separate directory, so it could be used in the future.

In order to extract vectors from existing .xcassets directory, you need to run whi command:

```
basset_ios -e <path_to_xcassets_dir> -r <path_to_vector_assets_dir>
```

## Example

1) First of all create new iOS project. Make sure it contains *xcassets* folder inside.
Expand Down
2 changes: 1 addition & 1 deletion basset/basset_ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def main(args_to_parse):
parser = argparse.ArgumentParser(description='Converts raw assets to proper PNG(s).')

main_group = parser.add_argument_group("Main arguments", "Assets converting and merging with xcassets")
extract_group = parser.add_argument_group("Extract group", "Extracting assets ")
extract_group = parser.add_argument_group("Extract arguments", "Extracting assets from existing .xcassets")

parser.add_argument('-r', '--raw_assets_dir', default="VectorAssets",
help='path to directory with raw, vector based graphics')
Expand Down
2 changes: 1 addition & 1 deletion basset/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, imageset_directory_path, assets_dir):
def get_message(self):
return "Found .xcassets directory with an asset inside: '{0}'. \n" \
"You cannot have existing xcassets inside vector assets directory. You can extract them with:\n" \
"basset_ios -e <path_to_xcassets> -r <path_to_vector_assets_dir>" \
"basset_ios -e <path_to_xcassets_dir> -r <path_to_vector_assets_dir>" \
"".format(self.imageset_directory_path)


Expand Down

0 comments on commit f9047c7

Please sign in to comment.