m-radzikowski / omnigraffle-stencil

Tool to create OmniGraffle stencils from SVG icons
https://pypi.org/project/omnigraffle-stencil/
MIT License
27 stars 2 forks source link

Support new AWS archive format #1

Closed Vlaaaaaaad closed 3 years ago

Vlaaaaaaad commented 3 years ago

Hi,

Creating this issue so other people know that the script needs tweaking for the new format πŸ™‚
Unfortunately, I don't think I'll have time to contribute a fix 😞

For the latest icon release, 2020-09-11, AWS changed the format of the archive, now having separate Services and Resources.

The extracted archive now looks like this:

AWS-Architecture-Assets-For-Light-and-Dark-BG_20200911
β”œβ”€β”€ AWS-Architecture-Resource-Icons_20200911
β”‚Β Β  β”œβ”€β”€ Res_Analytics
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ Res_48_Dark
β”‚Β Β  β”‚Β Β  └── Res_48_Light
β”‚Β Β  β”œβ”€β”€ Res_Application-Integration
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ Res_48_Dark
β”‚Β Β  β”‚Β Β  └── Res_48_Light
β”‚Β Β  β”œβ”€β”€ Res_Blockchain
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ Res_48_Dark
β”‚Β Β  β”‚Β Β  └── Res_48_Light

  ...

β”‚Β Β  └── Res_loT
β”‚Β Β      β”œβ”€β”€ Res_48_Dark
β”‚Β Β      └── Res_48_Light
└── AWS-Architecture-Service-Icons_20200911
    β”œβ”€β”€ Arch_AR-VR
    β”‚Β Β  β”œβ”€β”€ Arch_16
    β”‚Β Β  β”œβ”€β”€ Arch_32
    β”‚Β Β  β”œβ”€β”€ Arch_48
    β”‚Β Β  └── Arch_64
    β”œβ”€β”€ Arch_Analytics
    β”‚Β Β  β”œβ”€β”€ Arch_16
    β”‚Β Β  β”œβ”€β”€ Arch_32
    β”‚Β Β  β”œβ”€β”€ Arch_48
    β”‚Β Β  └── Arch_64
    β”œβ”€β”€ Arch_App-Integration
    β”‚Β Β  β”œβ”€β”€ Arch_16
    β”‚Β Β  β”œβ”€β”€ Arch_32
    β”‚Β Β  β”œβ”€β”€ Arch_48
    β”‚Β Β  └── Arch_64

    ...

    β”œβ”€β”€ Arch_Security-Identity-Compliance
    β”‚Β Β  β”œβ”€β”€ 16
    β”‚Β Β  β”œβ”€β”€ 32
    β”‚Β Β  β”œβ”€β”€ 48
    β”‚Β Β  └── 64
    └── Arch_Storage
        β”œβ”€β”€ 16
        β”œβ”€β”€ 32
        β”œβ”€β”€ 48
        └── 64

186 directories, 0 files
m-radzikowski commented 3 years ago

Hey, thank you for the info. I released version 1.1.0 with improvements to handle that. Now nested directory structure is supported, see example in README for how to adjust group (sheet) names. Also, I put a new stencil with 2020-09-11 icons in Stenciltown: https://stenciltown.omnigroup.com/stencils/aws-2020-09-11-all/

Vlaaaaaaad commented 3 years ago

Wow, that was fast and unexpected! Thank you so much!

Turns out that AWS made a mistake and named the Light Resources inGeneral as *_Dark.svg, because of course there had to be something going wrong 🀣

After some experiments, here are the full commands for stencil generation, with all the options:

# Generate Service icons (big colorful squares, no theme version)
omnigraffle-stencil \
    --svg-dir "AWS-Architecture-Assets-For-Light-and-Dark-BG_20200911/AWS-Architecture-Service-Icons_20200911" \
    --stencil-file AWS_20200911_Services_Light.gstencil \
    --filename-includes _48 \
    --stencil-name-remove Arch_ _48 . - _ \
    --group-name-remove Arch_ . - _

# Fix badly named files from AWS
rename \
    's/_Dark/_Light/' \
    AWS-Architecture-Assets-For-Light-and-Dark-BG_20200911/AWS-Architecture-Resource-Icons_20200911/Res_General-Icons/Res_48_Light/*.svg

# Generate Resource stencils, for Dark backgrounds
omnigraffle-stencil \
    --svg-dir "AWS-Architecture-Assets-For-Light-and-Dark-BG_20200911/AWS-Architecture-Resource-Icons_20200911" \
    --stencil-file AWS_20200911_Resources_Dark.gstencil \
    --filename-includes _48_Dark \
    --stencil-name-remove Res_ _48_Dark . - _ \
    --group-name-remove Res_ . - _

# Generate Resource stencils, for Light backgrounds
omnigraffle-stencil \
    --svg-dir "AWS-Architecture-Assets-For-Light-and-Dark-BG_20200911/AWS-Architecture-Resource-Icons_20200911" \
    --stencil-file AWS_20200911_Resources_Light.gstencil \
    --filename-includes _48_Light \
    --stencil-name-remove Res_ _48_Light . - _ \
    --group-name-remove Res_ . - _
m-radzikowski commented 3 years ago

Yes, they made a few more mistakes. Service names are different between Services and Resources, and in one of them instead of IoT there is loT, with lowercase L πŸ˜†

I fixed those in the stencil I generated and put on stenciltown.