{"id":20247603,"url":"https://github.com/qmui/qmui-images-distribution","last_synced_at":"2025-06-16T22:07:05.929Z","repository":{"id":65371981,"uuid":"63696775","full_name":"QMUI/qmui-images-distribution","owner":"QMUI","description":"适用于 QMUI 图片管理方式的辅助工具，自动把 sketch 导出的切片按 QMUI 要求改名并分发到各个目录","archived":false,"fork":false,"pushed_at":"2016-07-19T13:59:16.000Z","size":6,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-13T04:16:14.394Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/QMUI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-19T13:35:57.000Z","updated_at":"2024-12-13T09:18:31.000Z","dependencies_parsed_at":"2023-01-19T23:16:30.084Z","dependency_job_id":null,"html_url":"https://github.com/QMUI/qmui-images-distribution","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/QMUI/qmui-images-distribution","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QMUI%2Fqmui-images-distribution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QMUI%2Fqmui-images-distribution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QMUI%2Fqmui-images-distribution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QMUI%2Fqmui-images-distribution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QMUI","download_url":"https://codeload.github.com/QMUI/qmui-images-distribution/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QMUI%2Fqmui-images-distribution/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260249965,"owners_count":22980765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T09:38:06.749Z","updated_at":"2025-06-16T22:07:05.905Z","avatar_url":"https://github.com/QMUI.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# qmui-images-distribution\n\n\u003e 自动把 sketch 导出的切片按 QMUI 要求改名并分发到各个目录。由于 sketch 中输出的切图通常是按照 xxx.png，xxx_2x.png，xxx_3x.png 这样输出，而 QMUI 框架中要求多倍图的文件名相同，即不带\"_2x\"或“_3x”这类后缀，并放置到不同的目录中，因此造成不便，这个工具帮助把切图重命名并集中分发到对应的目录中。\n\n## Installation\n\n```shell\nnpm install --save-dev qmui-images-distribution \n```\n\n## Usage\n\n第一次使用时应该先运行一次 `gulp init`，这个任务会帮助创建配置表，配置表会放置在 qmui-images-distribution 的上一层目录，然后需要按照图片目录创建对应的字典，例如项目中图片目录结构如下：\n\n```shell\nimages\n├── commonImages\n├── commonImages_2x\n├── icons\n├── icons_2x\n├── mobile\n├── mobile_2x\n├── mobile_3x\n├── qmui-images-distribution // 本工具的目录\n└── config.json              // 配置表\n```\n\n则可以这样编写配置表：\n\n```json\n{\n  \"comment\" : \"图片目录名与关键字的配对\",\n  \"icon\": \"icons\",\n  \"common\": \"commonImages\",\n  \"mobile\": \"mobile\"\n} \n```\n\n保存配置表后则可以使用，例如 sketch 中切图输出共有 close.png，close_2x.png 两张图片，需要分别放置到 icons 和 icons_2x 两个目录中，则可以先把切图放置到 qmui-images-distribution/source 中，然后执行以下命令：\n```shell\ngulp --d icon \n```\n\n同理，如果有三张切图 logo.png，logo_2x.png，logo_3x.png 需要分别放置到 mobile，mobile_2x 和 mobile_3x 三个目录中，则可以这样操作：\n```shell\ngulp --d mobile\n```\n\n在 qmui-images-distribution 目录下运行以下命令可以查看完整的使用菜单\n```shell\ngulp help\n``` \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqmui%2Fqmui-images-distribution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqmui%2Fqmui-images-distribution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqmui%2Fqmui-images-distribution/lists"}