{"id":21247235,"url":"https://github.com/kikytokamuro/guile-webview","last_synced_at":"2025-03-15T05:14:14.757Z","repository":{"id":47953022,"uuid":"514375678","full_name":"KikyTokamuro/guile-webview","owner":"KikyTokamuro","description":"Wrapper for using libwebview from GNU Guile ","archived":false,"fork":false,"pushed_at":"2023-10-14T05:37:32.000Z","size":33,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-21T20:26:30.378Z","etag":null,"topics":["guile","scheme","webview"],"latest_commit_sha":null,"homepage":"","language":"Scheme","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/KikyTokamuro.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}},"created_at":"2022-07-15T18:58:02.000Z","updated_at":"2025-01-07T11:28:42.000Z","dependencies_parsed_at":"2024-01-07T16:31:07.732Z","dependency_job_id":"7ab20b87-75eb-43ff-8981-913b9af3e066","html_url":"https://github.com/KikyTokamuro/guile-webview","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/KikyTokamuro%2Fguile-webview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KikyTokamuro%2Fguile-webview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KikyTokamuro%2Fguile-webview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KikyTokamuro%2Fguile-webview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KikyTokamuro","download_url":"https://codeload.github.com/KikyTokamuro/guile-webview/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243685582,"owners_count":20330982,"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":["guile","scheme","webview"],"created_at":"2024-11-21T02:17:21.917Z","updated_at":"2025-03-15T05:14:14.737Z","avatar_url":"https://github.com/KikyTokamuro.png","language":"Scheme","funding_links":[],"categories":[],"sub_categories":[],"readme":"# guile-webview\n\nWrapper for using libwebview from GNU Guile \n\n### Dependencies\n- gtk+-3.0 \n- webkit2gtk-4.0\n- [bytestructures](https://github.com/TaylanUB/scheme-bytestructures)\n- [ffi-help-rt](https://git.savannah.nongnu.org/cgit/nyacc.git/tree/module/system/ffi-help-rt.scm)\n\n### Build\n```sh\ng++ ./webview/webview.cc -fPIC -shared -DWEBVIEW_BUILD_SHARED -DWEBVIEW_GTK -std=c++11 $(pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0) -o libwebview.so\n```\n\n### Install\nCopy `libwebview.so` to your shared libraries path, and `webview.scm` to you guile `(%site-dir)` path\n\n### Run example\n```sh\nLTDL_LIBRARY_PATH=. guile3.0 ./examples/clock.scm\n```\n\n### Example\nExample of use with [GuileScript](https://github.com/aconchillo/guilescript) and [htmlprag](https://www.nongnu.org/guile-lib/doc/ref/htmlprag/)\n\n![clock](./examples/clock.png)\n\n```scheme\n(use-modules (webview)\n\t     (htmlprag)\n\t     (ice-9 receive)\n\t     ((language guilescript compile) #:prefix gs:))\n\n(define js-script\n  (receive (js _)\n      (gs:compile\n       '(begin\n\t  (define (calcloop)\n\t    (let ((date (js-new Date))\n\t\t  (hour (js-invoke date getHours))\n\t\t  (min  (js-invoke date getMinutes))\n\t\t  (sec  (js-invoke date getSeconds))\n\t\t  (toHex (lambda (d)\n\t\t\t   (define hex (js-invoke (js-invoke (+ \"0\" (js-invoke (Number d) toString 16)) slice -2) toUpperCase))\n\t\t\t   hex))\n\t\t  (hex (+ \"#\" (toHex hour) (toHex min) (toHex sec))))\n\t      (js-set! (js-invoke document getElementById \"clock\") innerHTML (+ hour \":\" min \":\" sec))\n\t      (js-set! (js-invoke document getElementById \"clock-hex\") innerHTML hex)\n\t      (js-set! document.body.style background hex)))\n\t  (js-set! window onload (lambda ()\n\t\t\t\t   (setInterval calcloop 1000)))))\n    js))\n\n\n(define page-html\n  (sxml-\u003ehtml `(body (@ (style \"display:flex; flex-direction:column; justify-content:center; align-items:center\"))\n\t\t     (h1 (@ (id \"clock\")\n\t\t\t     (style \"color: #fff\")) \"\")\n\t\t     (h2 (@ (id \"clock-hex\")\n\t\t\t     (style \"color: #fff\")) \"\")\n\t\t     (script ,js-script))))\n\n(define wv (webview-create 1 (make-webview-t)))\n(webview-set-title wv \"Clock\")\n(webview-set-html wv page-html)\n(webview-set-size wv 250 250 0)\n(webview-run wv)\n```\n\nOther examples:\n- [Examples dir](./examples)\n- [guile-ram-mon](https://github.com/KikyTokamuro/guile-ram-mon)\n\n### Tested on\n```\nGNU Guile 3.0.7\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkikytokamuro%2Fguile-webview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkikytokamuro%2Fguile-webview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkikytokamuro%2Fguile-webview/lists"}