{"id":16184535,"url":"https://github.com/searls/html-to-preact-h","last_synced_at":"2025-03-19T02:31:23.024Z","repository":{"id":35734316,"uuid":"195154568","full_name":"searls/html-to-preact-h","owner":"searls","description":"Converts an HTML string to a string of preact hyperscript h() calls","archived":false,"fork":false,"pushed_at":"2022-04-28T22:37:48.000Z","size":152,"stargazers_count":4,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-19T23:51:55.626Z","etag":null,"topics":["hyperscript","preact","react"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/searls.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}},"created_at":"2019-07-04T02:19:41.000Z","updated_at":"2021-11-28T06:03:25.000Z","dependencies_parsed_at":"2022-08-08T10:31:41.289Z","dependency_job_id":null,"html_url":"https://github.com/searls/html-to-preact-h","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/searls%2Fhtml-to-preact-h","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/searls%2Fhtml-to-preact-h/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/searls%2Fhtml-to-preact-h/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/searls%2Fhtml-to-preact-h/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/searls","download_url":"https://codeload.github.com/searls/html-to-preact-h/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221720405,"owners_count":16869481,"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":["hyperscript","preact","react"],"created_at":"2024-10-10T07:10:28.636Z","updated_at":"2024-10-27T19:09:05.655Z","avatar_url":"https://github.com/searls.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# html-to-preact-h\n\nGenerates a string of [preact](https://preactjs.com) hyperscript `h()` function calls for a\ngiven HTML string. Designed to make it easier to embed snippets of markup\n(notably generated SVG files) into JavaScript source listings that use `h()`\nto render markup (as opposed to JSX).\n\n## Install\n\n```\nnpm install html-to-preact-h\n```\n\n## API\n\n```js\nconst htmlToPreactH = require('html-to-preact-h')\n\nconst result = htmlToPreactH('\u003ca href=\"https://example.com\"\u003eGreat example!\u003c/a\u003e')\n\nconsole.log(result)\n```\n\nWill print:\n\n```\nh('a', {href: 'https://example.com'}, 'Great example!')\n```\n\nIt handles things like nesting, dropping to 1 or 2 args when appropriate.\n\n## CLI\n\nJust pass a file path and it'll print out the `h()`'s you crave:\n\n```\n$ html-to-preact-h example.svg\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsearls%2Fhtml-to-preact-h","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsearls%2Fhtml-to-preact-h","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsearls%2Fhtml-to-preact-h/lists"}