{"id":23212801,"url":"https://github.com/gui-ying233/bricks","last_synced_at":"2025-06-12T05:07:16.905Z","repository":{"id":222052187,"uuid":"756122738","full_name":"gui-ying233/Bricks","owner":"gui-ying233","description":"一个用于解析 HTML 的 Lua 模块","archived":false,"fork":false,"pushed_at":"2024-04-12T06:15:19.000Z","size":31,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-05T12:44:32.479Z","etag":null,"topics":["html","lua","module"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/gui-ying233.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}},"created_at":"2024-02-12T01:40:36.000Z","updated_at":"2024-09-09T01:10:55.000Z","dependencies_parsed_at":"2024-02-14T11:27:48.741Z","dependency_job_id":"7f2f79f9-2385-401d-876e-6fcadb01a76d","html_url":"https://github.com/gui-ying233/Bricks","commit_stats":null,"previous_names":["gui-ying233/bricks"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gui-ying233/Bricks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gui-ying233%2FBricks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gui-ying233%2FBricks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gui-ying233%2FBricks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gui-ying233%2FBricks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gui-ying233","download_url":"https://codeload.github.com/gui-ying233/Bricks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gui-ying233%2FBricks/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259402010,"owners_count":22851867,"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","lua","module"],"created_at":"2024-12-18T19:13:17.012Z","updated_at":"2025-06-12T05:07:16.876Z","avatar_url":"https://github.com/gui-ying233.png","language":"Lua","readme":"# Bricks：一个用于解析 HTML 的 Lua 模块\n\nBricks 是一个解析 HTML 的 Lua 模块，整体类似于JS。\n\n半成品，心血来潮瞎写的。\n\n## 喵一喵\n\n```lua\nlocal b = require('bricks')\n\nlocal document = b:new([['\u003ch1 id=\"top\" class=\"heading heading-1\"\u003eHello!\u003c/h1\u003e\n\u003cdiv style=\"margin: 0 auto;\" class=\"container\"\u003e\n\t\u003cp\u003e\n\t\tMy name is \u003cdfn\u003eBricks\u003c/dfn\u003e, a module for parsing HTML.\u003cbr\u003e\n\t\tThank you for your visit.\n\t\u003c/p\u003e\n\t\u003cp\u003evisitors:\u003c/p\u003e\n\t\u003cul\u003e\n\t\t\u003cli\u003eACandy\u003c/li\u003e\n\t\t\u003cli\u003eBricks\u003c/li\u003e\n\t\t\u003cli\u003eCatgirl\u003c/li\u003e\n\t\t\u003cli\u003e...\u003c/li\u003e\n\t\u003c/ul\u003e\n\u003c/div\u003e']])\n\n\nlocal h1 = document:getElementById('top')\nprint(h1.id, h1.className)\n\nlocal div = document:getElementsByClassName('container')[1]\nprint(div.style.margin)\n\nlocal p = div:getElementsByTagName('p')[1]\nprint(p.innerHTML)\n\nlocal dfn = p.children[1]\nprint(dfn.outerHTML)\n```\n\n输出：\n\n```plaintext\ntop     heading heading-1\n0 auto\n\n                My name is \u003cdfn\u003eBricks\u003c/dfn\u003e, a module for parsing HTML.\u003cbr\u003e\n                Thank you for your visit.\n\n\u003cdfn\u003eBricks\u003c/dfn\u003e\n```\n\n## 支持\n\n**初始化**：`b:new()`\n\n**获取元素**：`document:getElementsByTagName()`、`document:getElementById()`、`document:getElementsByClassName()`\n\n**元素属性**：`ele.tagName`、`ele.outerHTML`、`ele.innerHTML`、`ele.attributes`、`ele.id`、`ele.classList`、`ele.className`、`ele.style`、`ele.dataset`、`ele.children`、`ele.parentElement`\n\n## 友情推荐\n\n[ACandy](https://github.com/AmeroHan/ACandy \"ACandy\"): a sugary Lua module for building HTML\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgui-ying233%2Fbricks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgui-ying233%2Fbricks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgui-ying233%2Fbricks/lists"}