{"id":22136466,"url":"https://github.com/kuredoro/haisu","last_synced_at":"2025-03-24T10:16:18.128Z","repository":{"id":123887611,"uuid":"291792317","full_name":"kuredoro/haisu","owner":"kuredoro","description":"Align code on boundaries of commas, braces, (you name it).","archived":false,"fork":false,"pushed_at":"2021-12-01T08:51:58.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T21:17:45.916Z","etag":null,"topics":["aligner","beautifier","characters","formatter","tool"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kuredoro.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-08-31T18:21:42.000Z","updated_at":"2021-12-01T08:52:01.000Z","dependencies_parsed_at":"2024-04-01T06:27:24.616Z","dependency_job_id":"d7302084-78f6-48f6-af27-566ef5420c35","html_url":"https://github.com/kuredoro/haisu","commit_stats":null,"previous_names":["kureduro/haisu"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuredoro%2Fhaisu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuredoro%2Fhaisu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuredoro%2Fhaisu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuredoro%2Fhaisu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kuredoro","download_url":"https://codeload.github.com/kuredoro/haisu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245249232,"owners_count":20584497,"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":["aligner","beautifier","characters","formatter","tool"],"created_at":"2024-12-01T19:22:37.160Z","updated_at":"2025-03-24T10:16:18.100Z","avatar_url":"https://github.com/kuredoro.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Haisu : a code aligner\n\nBasically, turn this \n```\n{ TokenType::ForLoop, 1, 0, \"for\"}, { TokenType::Identifier, 1, 4, \"i\" },\n{ TokenType::InRange, 1, 6, \"in\"}, { TokenType::ReverseRange, 1, 9, \"reverse\" },\n{ TokenType::IntegerLiteral, 1, 17, \"1\" }, { TokenType::TwoDots, 1, 18, \"..\" },\n{ TokenType::IntegerLiteral, 1, 20, \"42\" }, { TokenType::LoopBegin, 1, 23, \"loop\" },\n{ TokenType::NewLine, 1, 27, \"\\n\" },\n```\n\ninto this\n```\n\n{       TokenType::ForLoop, 1,  0, \"for\"}, {  TokenType::Identifier, 1,  4,       \"i\"},\n{       TokenType::InRange, 1,  6,  \"in\"}, {TokenType::ReverseRange, 1,  9, \"reverse\"},\n{TokenType::IntegerLiteral, 1, 17,   \"1\"}, {     TokenType::TwoDots, 1, 18,      \"..\"},\n{TokenType::IntegerLiteral, 1, 20,  \"42\"}, {   TokenType::LoopBegin, 1, 23,    \"loop\"},\n{       TokenType::NewLine, 1, 27,  \"\\n\"},\n```\n\n### Building\n\n```\n$ go build .\n```\n\nIt will produce an executable inside the directory.\n\n### Usage\n\nTo make any use of it, you need to supply a set of alignment characters. These characters will be vertically aligned in the output. The program reads lines via `stdin`.\n\n```\n$ printf \"\\t{Line one, two}\\n\\t{three, four}\" | ./haisu \"{,}\"\n    {Line one,  two}\n    {   three, four}\n```\n\nI have come with this hacky workflow: open a text file in vim, copy needed lines there, then type\n```\n:!cat file | ./haisu \"{},\" | xclip -selection clipboard\n```\n\nThis will copy the transformed lines into the clipboard.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuredoro%2Fhaisu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkuredoro%2Fhaisu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuredoro%2Fhaisu/lists"}