{"id":15511449,"url":"https://github.com/Normal-Tangerine8609/Scriptable-HTML-Widget","last_synced_at":"2025-10-12T08:31:29.333Z","repository":{"id":49317219,"uuid":"426302823","full_name":"Normal-Tangerine8609/Scriptable-HTML-Widget","owner":"Normal-Tangerine8609","description":"Create Scriptable widgets with HTML-like syntax","archived":false,"fork":false,"pushed_at":"2024-02-27T16:30:33.000Z","size":1751,"stargazers_count":34,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-02T09:53:40.966Z","etag":null,"topics":["apple","html","ios","javascript","scriptable","scriptable-app","widget"],"latest_commit_sha":null,"homepage":"https://normal-tangerine8609.gitbook.io/html-widget/","language":"JavaScript","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/Normal-Tangerine8609.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","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":"2021-11-09T16:24:00.000Z","updated_at":"2024-09-18T21:16:59.000Z","dependencies_parsed_at":"2024-10-02T09:53:46.266Z","dependency_job_id":"7268f980-5dda-4b40-964b-fc14344cedcf","html_url":"https://github.com/Normal-Tangerine8609/Scriptable-HTML-Widget","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/Normal-Tangerine8609%2FScriptable-HTML-Widget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normal-Tangerine8609%2FScriptable-HTML-Widget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normal-Tangerine8609%2FScriptable-HTML-Widget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normal-Tangerine8609%2FScriptable-HTML-Widget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Normal-Tangerine8609","download_url":"https://codeload.github.com/Normal-Tangerine8609/Scriptable-HTML-Widget/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236188306,"owners_count":19109388,"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":["apple","html","ios","javascript","scriptable","scriptable-app","widget"],"created_at":"2024-10-02T09:53:02.755Z","updated_at":"2025-10-12T08:31:29.325Z","avatar_url":"https://github.com/Normal-Tangerine8609.png","language":"JavaScript","readme":"# HTML Widget\n![Logo](/images/logo.jpeg) \n\nHTML Widget allows you to create [Scriptable](https://scriptable.app/) widgets in HTML-like syntax. HTML Widget is easy to use and supports all widget features.\n\n## Documentation\n\n[Link](https://normal-tangerine8609.gitbook.io/html-widget/)\n\n## Features\n\n* Simplifies gradients: `to top left, #134E5E, #71B280`.\n* Supports HSL, HSLA, RGB, RGBA, hex or CSS colour names like `red`.\n* Style elemnts with a CSS-like syntax or attributes.\n* Easily share styles between elements with classes.\n* Use addons like `symbol` to simplify adding SFSymbols to widgets.\n\n## Example\n\n![Small Reddit Widget](/images/RedditWidget.jpeg)\n\n```javascript\nconst htmlWidget = importModule(\"html-widget\");\nconst symbol = importModule(\"html-widget-symbol\");\nconst addons = { symbol };\n\nconst json = await new Request(\n  \"https://www.reddit.com/r/Showerthoughts.json\"\n).loadJSON();\nconst post = json.data.children[Math.floor(Math.random() * 10)].data;\nconst title = post.title.replace(/\u003c/g, \"\u0026lt;\").replace(/\u003e/g, \"\u0026gt;\");\nconst body = post.selftext.replace(/\u003c/g, \"\u0026lt;\").replace(/\u003e/g, \"\u0026gt;\");\nconst ups = post.ups;\nconst upsRatio = post.upvote_ratio;\nconst comments = post.num_comments;\nconst url = post.url;\nconst widget = await htmlWidget(\n  `\n\u003cwidget refresh-after-date=\"15\" url=\"${url}\"\u003e\n  \u003cstyle\u003e\n    symbol {\n      image-size: 13,13;\n    }\n    text {\n      font: system-ui, 11;\n      minimum-scale-factor: 0.3;\n    }\n    .title {\n      font: system-ui, 13;\n      align-text: center;\n    }\n    .bottom-bar {\n      align-content: center;\n    }\n    .bottom-bar \u003e text {\n      line-limit: 1\n    }\n  \u003c/style\u003e\n  \u003ctext class=\"title\"\u003eShowerthoughts\u003c/text\u003e\n  \u003cspacer space=\"5\"/\u003e\n  \u003ctext\u003e${title}\u003c/text\u003e\n  \u003ctext\u003e${body}\u003c/text\u003e\n  \u003cstack class=\"bottom-bar\"\u003e\n    \u003csymbol\u003earrow.up.circle.fill\u003c/symbol\u003e\n    \u003cspacer space=\"2\"/\u003e\n    \u003ctext\u003e${ups}\u003c/text\u003e\n    \u003cspacer/\u003e\n    \u003csymbol\u003estar.circle.fill\u003c/symbol\u003e\n    \u003cspacer space=\"2\"/\u003e\n    \u003ctext\u003e${upsRatio}\u003c/text\u003e\n    \u003cspacer/\u003e\n    \u003csymbol\u003emessage.circle.fill\u003c/symbol\u003e\n    \u003cspacer space=\"2\"/\u003e\n    \u003ctext\u003e${comments}\u003c/text\u003e\n  \u003c/stack\u003e\n\u003c/widget\u003e\n`,\n  true,\n  addons\n);\nScript.setWidget(widget);\nwidget.presentSmall();\nScript.complete();\n```\n\n## Module\n\nIf you would prefer to use a module instead of a function follow these steps:\n\n1. Copy the file from the [html-widget.js](cody/html-widget.js) and paste it into a new Scriptable script \n2. Rename the script to `Scriptable-HTML-Widget`\n3. Create a new script and paste `const htmlWidget = importModule(\"Scriptable-HTML-Widget\")` at the top of the file\n4. Start to create the widget as you would normally\n\n## Bugs and Feedback \n\nIf you find any bugs please message me. My preferred mode of communication is Reddit but fell free to post the issues to this respiratory.\n \n[u/Normal-Tangerine8609](https://www.reddit.com/user/Normal-Tangerine8609)\n\n## Support\n\nThanks for the support of the [r/Scriptable](https://www.reddit.com/r/Scriptable/) community.\n\nThanks for [u/TheLongConIsGone](https://www.reddit.com/user/TheLongConIsGone) and [u/Glassounds](https://www.reddit.com/user/Glassounds) for answering some of my scriptable questions.\n\nThanks for [henryluki](https://github.com/henryluki), the creator of the  [HTML parser](https://github.com/henryluki/html-parser) once used in the script.\n\nThanks for you visiting or trying out HTML Widget!\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNormal-Tangerine8609%2FScriptable-HTML-Widget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNormal-Tangerine8609%2FScriptable-HTML-Widget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNormal-Tangerine8609%2FScriptable-HTML-Widget/lists"}