{"id":30067327,"url":"https://github.com/maomincoding/babel-plugin-mettle-html","last_synced_at":"2025-08-08T08:55:36.423Z","repository":{"id":263083371,"uuid":"889107081","full_name":"maomincoding/babel-plugin-mettle-html","owner":"maomincoding","description":"A Babel plugin that compiles the template string in mettle.js into a normal object.","archived":false,"fork":false,"pushed_at":"2025-07-17T16:37:29.000Z","size":60,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-02T16:41:23.856Z","etag":null,"topics":["babel","babel-plugin","mettle","mettlejs"],"latest_commit_sha":null,"homepage":"https://maomincoding.github.io/mettle-doc/tool/babelPluginMettle/","language":"JavaScript","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/maomincoding.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-11-15T16:13:53.000Z","updated_at":"2025-07-17T16:35:40.000Z","dependencies_parsed_at":"2025-07-10T12:44:55.990Z","dependency_job_id":"f8b43553-7da1-43ad-8a5e-29b9412dca76","html_url":"https://github.com/maomincoding/babel-plugin-mettle-html","commit_stats":null,"previous_names":["maomincoding/babel-plugin-strve","maomincoding/babel-plugin-mettle","maomincoding/babel-plugin-mettle-html"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/maomincoding/babel-plugin-mettle-html","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maomincoding%2Fbabel-plugin-mettle-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maomincoding%2Fbabel-plugin-mettle-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maomincoding%2Fbabel-plugin-mettle-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maomincoding%2Fbabel-plugin-mettle-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maomincoding","download_url":"https://codeload.github.com/maomincoding/babel-plugin-mettle-html/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maomincoding%2Fbabel-plugin-mettle-html/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269393797,"owners_count":24409758,"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-08-08T02:00:09.200Z","response_time":72,"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":["babel","babel-plugin","mettle","mettlejs"],"created_at":"2025-08-08T08:55:35.926Z","updated_at":"2025-08-08T08:55:36.405Z","avatar_url":"https://github.com/maomincoding.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Babel-plugin-mettle-html\n\nA Babel plugin that compiles the template string in mettle.js into a normal object.\n\n## Usage\n\nIn your Babel configuration (`.babelrc`, `babel.config.js`, `\"babel\"` field in package.json, etc), add the plugin:\n\n```js\n{\n  \"plugins\": [\n    [\"babel-plugin-mettle-html\"]\n  ]\n}\n```\n\n### options\n\n#### `tag=html`\n\nBy default, `babelPluginMettleHtml` will process all Tagged Templates with a tag function named `html`. To use a different name, use the `tag` option in your Babel configuration:\n\n```js\n{\"plugins\":[\n  [\"babel-plugin-mettle-html\", {\n    \"tag\": \"html\"\n  }]\n]}\n```\n\n### other modes\n\nBy default, ` html`` ` will be used as a tag template mode. If there are other scenarios, you can choose to call the expression mode, there are two.\n\n1. The function name is `tem_h`, and the parameter is a template string.\n\n```js\ntem_h(`\u003cp\u003ehello\u003c/p\u003e`);\n```\n\n2. The function name is `str_h`, and the parameters are ordinary strings.\n\n```js\nstr_h('\u003cp\u003ehello\u003c/p\u003e');\n```\n\n\u003e Whether you choose the default mode or call the expression mode, their final output structure is the same. In addition, these modes we can use at the same time.\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2022-present, maomincoding\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaomincoding%2Fbabel-plugin-mettle-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaomincoding%2Fbabel-plugin-mettle-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaomincoding%2Fbabel-plugin-mettle-html/lists"}