{"id":13995975,"url":"https://github.com/ephread/sophisticate","last_synced_at":"2025-10-13T03:43:15.333Z","repository":{"id":57366169,"uuid":"85593760","full_name":"ephread/sophisticate","owner":"ephread","description":"Sophisticate SVG editors outputs to display them within interactive web pages.","archived":false,"fork":false,"pushed_at":"2020-07-16T22:54:41.000Z","size":340,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T20:16:40.323Z","etag":null,"topics":["converter","preprocessor","svg","transformer"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/sophisticate","language":"TypeScript","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/ephread.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-03-20T15:28:51.000Z","updated_at":"2021-08-09T20:56:07.000Z","dependencies_parsed_at":"2022-08-23T19:31:05.166Z","dependency_job_id":null,"html_url":"https://github.com/ephread/sophisticate","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ephread/sophisticate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ephread%2Fsophisticate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ephread%2Fsophisticate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ephread%2Fsophisticate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ephread%2Fsophisticate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ephread","download_url":"https://codeload.github.com/ephread/sophisticate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ephread%2Fsophisticate/sbom","scorecard":{"id":378963,"data":{"date":"2025-08-11","repo":{"name":"github.com/ephread/sophisticate","commit":"41abd6c4b9193418b68c8a435e0c825671461632"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/20 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"45 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-phwq-j96m-2c2q","Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-773h-w45w-f2f9","Warn: Project is vulnerable to: GHSA-6433-x5p4-8jc7","Warn: Project is vulnerable to: GHSA-mg49-jqgw-gcj6","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T14:57:03.092Z","repository_id":57366169,"created_at":"2025-08-18T14:57:03.092Z","updated_at":"2025-08-18T14:57:03.092Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013517,"owners_count":26085368,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["converter","preprocessor","svg","transformer"],"created_at":"2024-08-09T14:03:42.685Z","updated_at":"2025-10-13T03:43:15.308Z","avatar_url":"https://github.com/ephread.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# ![Sophisticate](https://i.imgur.com/5bZeKDu.png)\n[![Build Status](https://travis-ci.org/ephread/sophisticate.svg?branch=master)](https://travis-ci.org/ephread/sophisticate)\n[![codebeat badge](https://codebeat.co/badges/1ecccdd2-8572-4597-9db5-782584384242)](https://codebeat.co/projects/github-com-ephread-sophisticate-master)\n[![codecov](https://codecov.io/gh/ephread/sophisticate/branch/master/graph/badge.svg)](https://codecov.io/gh/sophisticate)\n[![npm version](https://img.shields.io/npm/v/sophisticate.svg)](https://www.npmjs.com/package/sophisticate)\n[![Install Size](https://packagephobia.now.sh/badge?p=sophisticate)](https://packagephobia.now.sh/result?p=sophisticate)\n[![Dependencies](https://david-dm.org/ephread/sophisticate/status.svg)](https://david-dm.org/ephread/sophisticate)\n[![Install Size](https://img.shields.io/npm/l/sophisticate.svg)](https://github.com/ephread/sophisticate/blob/master/LICENSE)\n\nSophisticate the SVG outputs of vector graphic editors.\n\nOutputs from vector graphic editor can be messy and require significant hand-made changes to become animatable and interactive. Sophisticate automates these changes.\n\n**⚠️ Until Sophisticate reaches 1.0.0, the configuration file syntax and the command line interface may change without notice.**\n\n## Table of contents\n\n  * [Installation](#installation)\n  * [Usage](#usage)\n  * [Configuration file](#configuration-file)\n    * [Sophistication rules](#sophistication-rules)\n    * [SVGO](#svgo)\n  * [License](#license)\n\n## Getting started\n\n### Install\n\nInstall the package from [npm].\n\n```shell\n$ npm install -g sophisticate\n```\n\n[npm]: https://npmjs.com/release\n\n## Usage\n\nThe utility bundles three commands. The config file argument is always optional. If omitted, Sophisticate will look for a file named `.sophisticate.yml` in the current directory.\n\n### `svg`\n\nUse the rules defined in `\u003cconfig-file\u003e` to sophisticate `\u003csvg\u003e` and output the result in `\u003coutput-directory\u003e`.\n\n```shell\n$ sophisticate svg -o \u003coutput-directory\u003e [-c \u003cconfig-file\u003e] \u003csvg\u003e...\n```\n\n### `html`\n\nUse the rules defined in `\u003cconfig-file\u003e` to sophisticate `\u003csvg\u003e` and output a generated HTML file based on `\u003ctemplate\u003e` in `\u003coutput-directory\u003e`. Optionally,\nspecifying the `-s` flag will process and merge together all specified `\u003csvg\u003e` according to `\u003ctemplate\u003e`.\n\n```shell\n$ sophisticate html -o \u003coutput-directory\u003e [-c \u003cconfig-file\u003e] \\\n                    [-t \u003ctemplate\u003e] [-s [\u003cbase-name\u003e]] \u003csvg\u003e...\n```\n\nWhen using the `-s` flag, make sure you provide a template expecting an array of SVGs. See [`examples/template-multiple.ejs`]\n\n[`examples/template-multiple.ejs`]: https://github.com/ephread/Sophisticate/blob/master/examples/template-multiple.ejs\n\n### `match`\n\nTest the configuration specified by `\u003cconfig-file\u003e` against the given `\u003csvg\u003e`. This command is useful to debug XPath queries.\n\n```shell\n$ sophisticate match -c \u003cconfig-file\u003e \u003csvg\u003e\n```\n\n## Configuration File\n\nThe configuration file is an array of rulesets, with each rulesets defining rules to apply on nodes matching the provided XPath queries. The file is YAML-based. and an example can be found in [`example/`].\n\n[`example/`]: https://github.com/ephread/Sophisticate/blob/master/examples/sophisticate-world-map.yml\n\nSince each ruleset is applied on the previously _sophisticated_ document, the order in which you define the rulesets is important.\n\nEach ruleset contains a single XPath query.\n\n### Sophistication rules\n\nFor each ruleset, you can specify one or more rules to apply on the given XPath query. Similarly, rules are applied one after another, on the transformed output. The order in which you define the rules is important.\n\n#### `addAttribute`\n\nAdd an attribute to the given nodes matching the specified XPath query.\n\nFor instance, the following rule will add the `class=\"outfit\"` and `data-wool=\"super150s\"` to all `\u003cg id=\"tuxedo\"\u003e\u003c/g\u003e`.\n\n```yaml\nsophisticate:\n  - xpath: \"//xmlns:g[@id = 'tuxedo']\"\n    rules:\n      - type: addAttribute\n        append: true\n        attributes:\n          - class: outfit\n          - \"data-wool\": super150s\n```\n\nThe `append` parameter is optional; when set to true, the specified value of the attribute will be appended to pre-existing ones, rather than replace them altogether.\n\nFor instance,\n\n```xml\n\u003cg id=\"tuxedo\" class=\"sophisticated\"\u003e\u003c/g\u003e\n```\n\nwill become :\n\n```xml\n\u003cg id=\"tuxedo\"\n   class=\"sophisticated outfit\"\n   data-wool=\"super150s\"\u003e\u003c/g\u003e\n```\n\n#### `removeAttribute`\n\nRemove an attribute from the given nodes matching the specified XPath query.\n\nFor instance, the following rule will remove the `style` attribute from all `\u003cg id=\"tuxedo\"\u003e\u003c/g\u003e`.\n\n```yaml\n- xpath: \"//xmlns:*[@style]\"\n  rules:\n    - type: removeAttribute\n      attributes:\n        - style\n```\n\n#### `renameAttribute`\n\nRename an attribute from the given nodes matching the specified XPath query.\n\nFor instance, the following rule will rename the `id` attribute to the `class` attribute, while keeping the value, for all `\u003cg id=\"tuxedo\"\u003e\u003c/g\u003e`\n\n```yaml\n- xpath: \"//xmlns:g[@id = 'tuxedo']\"\n  rules:\n    - type: renameAttribute\n      attributes:\n        - id: class\n```\n\nThe following tag,\n\n```xml\n\u003cg id=\"tuxedo\"\u003e\u003c/g\u003e\n```\n\nwill become :\n\n```xml\n\u003cg class=\"tuxedo\"\u003e\u003c/g\u003e\n```\n\n#### `copyAttribute`\n\nCopy an attribute from the given nodes matching the specified XPath query.\n\nFor instance, the following rule will copy the `id` attribute into the `class` attribute, for all `\u003cg id=\"tuxedo\"\u003e\u003c/g\u003e`\n\n```yaml\n- xpath: \"//xmlns:g[@id = 'tuxedo']\"\n  rules:\n    - type: copyAttribute\n      attributes:\n        - id: class\n```\n\nThe following tag,\n\n```xml\n\u003cg id=\"tuxedo\"\u003e\u003c/g\u003e\n```\n\nwill become :\n\n```xml\n\u003cg id=\"tuxedo\" class=\"tuxedo\"\u003e\u003c/g\u003e\n```\n\n#### `removeTag`\n\nRemove all tags matching the specified XPath query.\n\nFor instance, the following rule will remove any tag having `class=\"patchedShirt\"`.\n\n```yaml\n- xpath: \"//xmlns:*[@class = 'patchedShirt']\"\n  rules:\n    - type: removeTag\n```\n\n### SVGO\n\nIn addition to the transformations, sophisticate will run the output through SVGO.\n\nYou can configure the rules used by SVGO by adding them under the optional `svgo:` item in your configuration file. If `svgo:` is not specified, the [default configuration] will be used.\n\n[default configuration]: https://github.com/ephread/Sophisticate/blob/master/config/svgo.yml\n\n## License\n\nInstructions is released under the MIT license. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fephread%2Fsophisticate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fephread%2Fsophisticate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fephread%2Fsophisticate/lists"}