{"id":20528872,"url":"https://github.com/dkter/html-witchcraft","last_synced_at":"2025-04-14T04:53:43.222Z","repository":{"id":144098560,"uuid":"268210543","full_name":"dkter/html-witchcraft","owner":"dkter","description":"not your typical python HTML generator","archived":false,"fork":false,"pushed_at":"2020-06-29T01:01:25.000Z","size":17,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T18:52:45.265Z","etag":null,"topics":["html","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dkter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2020-05-31T04:45:28.000Z","updated_at":"2021-10-04T17:59:14.000Z","dependencies_parsed_at":"2023-03-25T01:36:21.387Z","dependency_job_id":null,"html_url":"https://github.com/dkter/html-witchcraft","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/dkter%2Fhtml-witchcraft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkter%2Fhtml-witchcraft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkter%2Fhtml-witchcraft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkter%2Fhtml-witchcraft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dkter","download_url":"https://codeload.github.com/dkter/html-witchcraft/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248824693,"owners_count":21167343,"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":["html","python"],"created_at":"2024-11-15T23:27:44.820Z","updated_at":"2025-04-14T04:53:43.215Z","avatar_url":"https://github.com/dkter.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## html-witchcraft\n\n### FAQ\n\n#### What does it do?\n\nSee for yourself -\n\n```python\nfrom witchcraft import Page\nclass ExamplePage(Page):\n    def render(self):\n        return ...[\n            [html]\n                [head]\n                    [title] (\"My Cool Website\") [-title]\n                [-head]\n                [body]\n                    [marquee][h1] (\"Wheeeeeeeeee\") [-h1][-marquee]\n                [-body]\n            [-html]\n        ]\n\npage = ExamplePage()\nprint(page.render())\n```\n\n```\n$ python test.py\n\u003chtml\u003e\u003chead\u003e\u003ctitle\u003eMy Cool Website\u003c/title\u003e\u003c/head\u003e\u003cbody\u003e\u003cmarquee\u003e\u003ch1\u003eWheeeeeeeeee\u003c/h1\u003e\u003c/marquee\u003e\u003c/body\u003e\u003c/html\u003e\n```\n\n(see another example at [example.py](https://github.com/dkter/html-witchcraft/blob/main/example.py)!)\n\n#### what the heck\n\nI'm glad you enjoyed it.\n\n#### Should I use this?\n\nProbably not. This was mainly intended as a fun project and proof of concept to see the extent of what I could do with metaprogramming in Python. Most people probably don't know this is possible!\nObviously this doesn't have as many features as, say, [jinja2](https://palletsprojects.com/p/jinja/) or [dominate](https://github.com/Knio/dominate) and I haven't tried to break it at all so there may be vulnerabilities somewhere. It's just cool.\n\n#### But how does it work?\n\nI might post a full technical explanation later. In the meantime, have a look at [witchcraft.py](https://github.com/dkter/html-witchcraft/blob/main/witchcraft.py). It's pretty well documented.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkter%2Fhtml-witchcraft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdkter%2Fhtml-witchcraft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkter%2Fhtml-witchcraft/lists"}