{"id":13471107,"url":"https://github.com/grkek/haki","last_synced_at":"2025-04-27T06:53:05.896Z","repository":{"id":42563872,"uuid":"309474490","full_name":"grkek/haki","owner":"grkek","description":"Build native apps using GTK4 and a dialect of HTML, declarative format allows you to create advanced structures with ease.","archived":false,"fork":false,"pushed_at":"2023-06-15T15:11:44.000Z","size":1453,"stargazers_count":81,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-27T06:52:59.341Z","etag":null,"topics":["codegen","css","gtk","gtk4","gui","html","js","native","native-gui","transpiler","ui"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/grkek.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,"publiccode":null,"codemeta":null}},"created_at":"2020-11-02T19:30:47.000Z","updated_at":"2025-04-07T14:44:10.000Z","dependencies_parsed_at":"2024-10-24T16:45:03.472Z","dependency_job_id":"c758d05d-d746-4d79-81a8-180510a12a63","html_url":"https://github.com/grkek/haki","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"58917ad07fd9559e07f2f1f8aca18f34c5d736af"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grkek%2Fhaki","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grkek%2Fhaki/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grkek%2Fhaki/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grkek%2Fhaki/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grkek","download_url":"https://codeload.github.com/grkek/haki/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251099735,"owners_count":21536153,"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":["codegen","css","gtk","gtk4","gui","html","js","native","native-gui","transpiler","ui"],"created_at":"2024-07-31T16:00:39.903Z","updated_at":"2025-04-27T06:53:05.873Z","avatar_url":"https://github.com/grkek.png","language":"Crystal","funding_links":[],"categories":["Crystal"],"sub_categories":[],"readme":"# Haki\n\n[![Showcase](https://i.postimg.cc/RCKxYtZp/Screenshot-2022-10-06-at-17-14-42.png)](https://github.com/grkek/haki)\n\n### GUI framework with GTK4 component generation using HTML, CSS and JavaScript\n\n- None of the components generated by Layout contain anything remotely related to a Web-Browser.\n\n- Compiled binary reads the custom HTML and builds the GTK components. Since it is already a pre-built release version, it is pretty fast at generating the UI components.\n\n- The compiler supports CSS and JavaScript compilation, which glues the components and makes the UI interactive.\n\n- The JavaScript engine is Duktape, it supports Babel 6.26.0 and CoreJS 2.6.11.\n\n- The CSS is limited to GTK4 specification.\n\n## Installation\n\nBefore you clone the shard and build it, install the GTK libraries.\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  haki:\n    github: grkek/haki\n```\n\nAnd run this command in your terminal:\n\n```bash\nshards install\n./bin/gi-crystal\n```\n\n# Code example\nAdd this to your `application.cr`:\n\n```crystal\nrequire \"haki\"\n\n# Disable GC for now.\nGC.disable\n\nhtml = \u003c\u003c-HTML\n  \u003cApplication applicationId=\"com.haki.application\"\u003e\n    \u003cWindow title=\"Untitled Window\"\u003e\n      \u003cLabel\u003eHello, World!\u003c/Label\u003e\n    \u003c/Window\u003e\n  \u003c/Application\u003e\nHTML\n\nbuilder = Haki::Builder.new\n# Make sure you point the path the correct way.\nbuilder.build_from_string(html)\n```\n\nCompile the `application.cr` file.\n\n```bash\ncrystal run application.cr -Dpreview_mt --error-trace\n```\n\nAnd you should have a GUI window with a \"Hello, World!\" text.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrkek%2Fhaki","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrkek%2Fhaki","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrkek%2Fhaki/lists"}