{"id":25334018,"url":"https://github.com/promignis/knack","last_synced_at":"2025-07-05T00:04:57.350Z","repository":{"id":144364379,"uuid":"143648127","full_name":"Promignis/knack","owner":"Promignis","description":"cross platform framework using web technologies","archived":false,"fork":false,"pushed_at":"2019-01-12T10:30:49.000Z","size":4782,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-04T22:51:14.378Z","etag":null,"topics":[],"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/Promignis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-08-05T21:15:12.000Z","updated_at":"2018-12-23T19:53:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"c5abbca6-88ed-4cec-90d7-3cf5550570a2","html_url":"https://github.com/Promignis/knack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Promignis/knack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Promignis%2Fknack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Promignis%2Fknack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Promignis%2Fknack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Promignis%2Fknack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Promignis","download_url":"https://codeload.github.com/Promignis/knack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Promignis%2Fknack/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263636791,"owners_count":23492304,"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":"2025-02-14T05:33:39.562Z","updated_at":"2025-07-05T00:04:57.345Z","avatar_url":"https://github.com/Promignis.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Knack\nKnack is a framework to build cross platform applications using the web stack - \nHTML, CSS and Javascript.\nIt is built using https://github.com/zserge/webview as the webview.\nThe size is much smaller compared to electron.\n\nIt is under development.\n\n`go get github.com/promignis/knack`\n\nCurrent usage(**it will change**)\n\n      html/svg  files in views  folder (will pick index.html by default)\n      css       files in styles folder\n      js        files in js     folder\n      image     files in images folder\n\n### Inject\n```js\nwindow.onRuntimeLoad = function() {\n      _runtime.loadView(\"contacts.html\") // replaces the current html with ./views/contacts.html\n\n      _runtime.loadCss(\"filename.css\") // injects from ./styles/filename.css\n\n      _runtime.loadJs(\"bundle.js\") // injects from ./js/bundle.js\n\n      _runtime.loadImage(\"test.png\", \"test\") // injects ./images/test.png to img tag with id \"test\"\n}\n```\n\n### Files\nOpen file and get data in callback(will open native file browser)\n```js\n_runtime.openFile((fileData) =\u003e {\n      // do something with file data\n})\n```\nif callback not present returns Promise\n```js\n_runtime.openFile().then(fileData =\u003e {\n\n})\n```\nSave file with `fileData`\n\n```js\n_runtime.saveFile(fileData)\n```\n\n### Fuzzy match\nDo fuzzy match over a any dictionary\n```js\n// dict, word, levenshtein_distance, callback\n\n_runtime.fuzzyMatch([\"asd\", \"abc\"], \"ab\", 1, (results) =\u003e {\n  // returns array of results\n  // in this case \"abc\" as 1 distance away from \"ab\"\n})\n```\nif callback not present it returns Promise\n```js\n_runtime.fuzzyMatch([\"asd\", \"abc\"], \"ab\", 1).then(results =\u003e {\n      // output\n})\n```\n\n### Examples\nFuzzy search on files\n\n```js\n_runtime.getFileWalker(\"../\", (fileList) =\u003e {\n  let fileDict = JSON.parse(fileList).map(file =\u003e file.name)\n  _runtime.fuzzyMatch(fileDict, \"main.g\", 3, (fuzzyResults) =\u003e {\n    \n  })\n})\n```\n\nif you have [babel-async-await](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-async-to-generator) setup\n```js\n_runtime.getFileWalker(\"../\", async (fileList) =\u003e {\n  let fileDict = JSON.parse(fileList).map(file =\u003e file.name)\n  let fuzzyResults = await _runtime.fuzzyMatch(fileDict, \"main.g\", 3)\n})\n```\nbetter use via Promises\n\n`getFileWalker is planned to return Promise in future`\n\n\n## OSX\n\n### Build\n`./build-app.sh`\n\n### Run\n`./run-app.sh`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpromignis%2Fknack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpromignis%2Fknack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpromignis%2Fknack/lists"}