{"id":19273009,"url":"https://github.com/enzet/iconscript","last_synced_at":"2025-02-23T20:41:40.476Z","repository":{"id":58608542,"uuid":"529868823","full_name":"enzet/iconscript","owner":"enzet","description":"Generating icons using text commands","archived":false,"fork":false,"pushed_at":"2022-10-23T19:18:49.000Z","size":112,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-05T13:43:49.634Z","etag":null,"topics":["antlr","go","icons"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/enzet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-28T13:21:52.000Z","updated_at":"2022-12-14T14:34:07.000Z","dependencies_parsed_at":"2023-01-20T12:20:44.034Z","dependency_job_id":null,"html_url":"https://github.com/enzet/iconscript","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enzet%2Ficonscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enzet%2Ficonscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enzet%2Ficonscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enzet%2Ficonscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enzet","download_url":"https://codeload.github.com/enzet/iconscript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240378878,"owners_count":19792039,"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":["antlr","go","icons"],"created_at":"2024-11-09T20:40:00.807Z","updated_at":"2025-02-23T20:41:40.431Z","avatar_url":"https://github.com/enzet.png","language":"Go","readme":"# iconscript\n\nPaperscript parser for icon shape drawing.\n\nThis is a part of [Map Machine](https://github.com/enzet/map-machine) project.\n\n## JavaScript part\n\nInstall:\n\n```shell\nnpm install paper paperjs-offset\nnpm install -g live-server\n```\n\nRun:\n\n```shell\nlive-server\n```\n\n## Go part\n\nRequires: Go 1.19, ANTLR 4.10.1.\n\nInstall:\n\n```shell\ncd grammar\nantlr -Dlanguage=Go -o parser IconScript.g4\ncd ..\ngo build\n```\n\nYou may also test installation with `go test`.\n\n```shell\ngo run main.go -i \u003cfile path\u003e\n```\n\n## Syntax\n\n### Global context\n\n  - __width__ — stroke width.\n  - __position__ — current position of the cursor.\n\n### Commands\n\n`\u003cpositon\u003e` is 2D coordinates in the form `\u003cx\u003e,\u003cy\u003e` or `+\u003cx\u003e,\u003cy\u003e` (`+` means,\nthat the position is relative to the __position__).\n\n| Command | Description |\n|---|---|\n| `a` | Set adding mode (default mode) |\n| `r` | Set removing mode |\n| `w \u003cfloat\u003e` | Set __width__ to a value |\n| `p \u003cposition\u003e` | Set __position__ to a value |\n| `l [\u003cposition\u003e]` | Draw lines between positions |\n| `c \u003cposition\u003e \u003cfloat\u003e` | Draw circle specified by center point and radius |\n| `s \u003cposition\u003e \u003cposition\u003e` | Draw rectangle specified by top left and bottom right points |\n| `ar \u003cposition\u003e \u003cfloat\u003e \u003cfloat\u003e \u003cfloat\u003e` | Draw arc specified by center point, radius, and two angles in radians |\n\n### Variables\n\nVariable can be defined with `\u003cvariable\u003e = [\u003ccommand\u003e]` and accessed with\n`@\u003cvariable\u003e`.\n\n### Example\n\n```iconscript\ncube = lf +0,0 +2,0 +0,2 +-2,0 +0,-2\n{\n    %glider\n    p 6,2   @cube p +4,4 @cube\n    p +-8,4 @cube p +4,0 @cube p +4,0 @cube\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenzet%2Ficonscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenzet%2Ficonscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenzet%2Ficonscript/lists"}