{"id":16506201,"url":"https://github.com/keller-mark/with-html","last_synced_at":"2025-10-22T10:57:30.638Z","repository":{"id":252116472,"uuid":"839348945","full_name":"keller-mark/with-html","owner":"keller-mark","description":"(Ab)use python context managers to construct HTML","archived":false,"fork":false,"pushed_at":"2024-08-09T01:37:06.000Z","size":15,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-22T10:57:30.010Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/keller-mark.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-07T12:35:18.000Z","updated_at":"2024-08-09T01:37:10.000Z","dependencies_parsed_at":"2024-08-07T20:56:36.966Z","dependency_job_id":null,"html_url":"https://github.com/keller-mark/with-html","commit_stats":null,"previous_names":["keller-mark/with-html"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/keller-mark/with-html","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keller-mark%2Fwith-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keller-mark%2Fwith-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keller-mark%2Fwith-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keller-mark%2Fwith-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keller-mark","download_url":"https://codeload.github.com/keller-mark/with-html/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keller-mark%2Fwith-html/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280424211,"owners_count":26328462,"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","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2024-10-11T15:17:51.810Z","updated_at":"2025-10-22T10:57:30.623Z","avatar_url":"https://github.com/keller-mark.png","language":"Python","readme":"# with-html\n\n\u003c!--\n[![PyPI](https://img.shields.io/pypi/v/with_html)](https://pypi.org/project/with_html)\n--\u003e\n\n(Ab)use python context managers to construct HTML. Render the resulting tree using [anywidget](https://anywidget.dev).\n\n:warning: This is an experiment\n\n\u003c!--\n## Installation\n\n```sh\npip install with_html\n```\n--\u003e\n\n## Usage\n\n\n```python\nfrom with_html import create_root, RootWidget\n\nh = create_root()\n\ndef my_button(h):\n    h.button(\"submit\")\n\nwith h.div():\n    h.h1(\"Test\")\n    h.img(src=\"https://example.com/my_image.jpg\", width=200, height=200)\n    h.p(\"my paragraph\")\n    h(my_button)\n    h.p(\"another paragraph\")\n    with h.table(style=dict(border=\"1px solid red\")):\n        with h.tr():\n            h.th(\"Column 1\")\n            h.th(\"Column 2\")\n        with h.tr():\n            h.td(\"Value 1\")\n            h.td(\"Value 2\")\n\nw = RootWidget(h.root)\nw\n```\n\n\n\n## Development\n\n```sh\nconda create -n with-html python=3.12\nconda activate with-html\npip install -e \".[dev]\"\n```\n\n```sh\njupyter lab\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeller-mark%2Fwith-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeller-mark%2Fwith-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeller-mark%2Fwith-html/lists"}