{"id":13413126,"url":"https://github.com/goradd/html5tag","last_synced_at":"2026-02-02T06:29:15.281Z","repository":{"id":43123268,"uuid":"468219892","full_name":"goradd/html5tag","owner":"goradd","description":"html5tag generates html 5 tags","archived":false,"fork":false,"pushed_at":"2023-12-10T23:53:09.000Z","size":60,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-31T20:51:55.497Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/goradd.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}},"created_at":"2022-03-10T06:23:50.000Z","updated_at":"2024-05-05T14:15:12.000Z","dependencies_parsed_at":"2024-01-08T15:34:35.976Z","dependency_job_id":null,"html_url":"https://github.com/goradd/html5tag","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goradd%2Fhtml5tag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goradd%2Fhtml5tag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goradd%2Fhtml5tag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goradd%2Fhtml5tag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goradd","download_url":"https://codeload.github.com/goradd/html5tag/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243635235,"owners_count":20322902,"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":[],"created_at":"2024-07-30T20:01:33.836Z","updated_at":"2026-02-02T06:29:10.243Z","avatar_url":"https://github.com/goradd.png","language":"Go","readme":"[![Go Reference](https://pkg.go.dev/badge/github.com/goradd/html5tag.svg)](https://pkg.go.dev/github.com/goradd/html5tag)\n![Build Status](https://img.shields.io/github/workflow/status/goradd/html5tag/Go)\n[![Go Report Card](https://goreportcard.com/badge/github.com/goradd/html5tag)](https://goreportcard.com/report/github.com/goradd/html5tag)\n[![codecov](https://codecov.io/gh/goradd/html5tag/branch/main/graph/badge.svg?token=L8KC75KWWR)](https://codecov.io/gh/goradd/html5tag)\n\n# html5tag\n\nThe html5tag package contains utilities to generate html 5 tags. \nChoose between string versions of the\nfunctions for easy tag creation, or io.Writer versions for speed.\n\nhtml5tag also has a tag builder for convenience and can perform math operations\non numeric style values.\n\nhtml5tag does some checks to make sure tags are well-formed. For example,\nwhen adding data-* attributes, it will make sure the key used for the\nattribute does not violate html syntax rules.\n\nhtml5tag has options to pretty-print tags and the content of tags so they appear formatted\nin a document. However, in certain contexts, like in inline text, or in a textarea tag, adding\nextra returns and spaces changes the look of the output. In these situations, use the functions\nthat do not add spaces to the inner HTML of a tag.\n\nSome examples:\n\n```go\npackage main\n\nimport . \"github.com/goradd/html5tag\"\n\nmain() {\n\t\n\t// Render an input tag, inside a div tag, inside a body tag using different tag building mechanisms\n\n\ta := NewAttributes().\n\tSetID(\"myText\").\n\tSet(\"text\", \"Hi there\").\n\tSet(\"placeholder\", \"Write here\").\n\tSetClass(\"class1 class2\").\n\tSetStyle(\"width\":\"20em\")\n\t\n\tinputTag := RenderVoidTag(\"input\", a)\n\tdivTag := RenderTag(\"div\", Attriubtes{\"id\":\"inputWrapper\"}, inputTag)\n\t\n\tbodyTag := NewTagBuilder().\n\t\tTag(\"body\").\n\t\tID(\"bodyId\").\n\t\tInnerHtml(divTag).\n\t\tString()\n\t\n\tfmt.Print(bodyTag)\n}\n```\n\nFor complete documentation, start at the documentation for `RenderTag()` and `WriteTag()` and drill down from there.\n","funding_links":[],"categories":["GUI"],"sub_categories":["Search and Analytic Databases","检索及分析资料库"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoradd%2Fhtml5tag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoradd%2Fhtml5tag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoradd%2Fhtml5tag/lists"}