{"id":31952746,"url":"https://github.com/siguici/vml","last_synced_at":"2026-02-18T12:32:35.179Z","repository":{"id":309571311,"uuid":"1036312005","full_name":"siguici/vml","owner":"siguici","description":"A lightweight runtime HTML/XML builder for @Vlang — inspired by @Laravel Blade.","archived":false,"fork":false,"pushed_at":"2025-08-20T16:28:18.000Z","size":87,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-23T16:47:08.741Z","etag":null,"topics":["html-builder","template-engine","vlang","vlang-library","vlang-module","vlang-package","vml"],"latest_commit_sha":null,"homepage":"https://vpm.vlang.io/packages/siguici.vml","language":"V","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/siguici.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2025-08-11T22:17:40.000Z","updated_at":"2025-08-26T08:14:53.000Z","dependencies_parsed_at":"2025-08-16T04:45:29.721Z","dependency_job_id":null,"html_url":"https://github.com/siguici/vml","commit_stats":null,"previous_names":["siguici/vml"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/siguici/vml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siguici%2Fvml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siguici%2Fvml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siguici%2Fvml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siguici%2Fvml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siguici","download_url":"https://codeload.github.com/siguici/vml/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siguici%2Fvml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29578991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T08:38:15.585Z","status":"ssl_error","status_checked_at":"2026-02-18T08:38:14.917Z","response_time":162,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["html-builder","template-engine","vlang","vlang-library","vlang-module","vlang-package","vml"],"created_at":"2025-10-14T13:24:16.867Z","updated_at":"2026-02-18T12:32:35.147Z","avatar_url":"https://github.com/siguici.png","language":"V","readme":"# 🚀 VML — Vlang Markup Language\n\n**VML** is a lightweight, **runtime HTML/XML builder** for **Vlang**.\nIt allows **dynamic, functional construction of documents, elements,\nand components** at runtime —\nno pre-compilation required! ⚡️\n\n---\n\n## ✨ Features\n\n* 🔹 **Elements** (`builder.element`)\n  Create standard HTML/XML tags dynamically with attributes and children.\n\n  ```v\n  b.element('div', { 'class': 'container' }, b.text('Hello World!'))\n  ```\n\n* 🔹 **Components** (`builder.component`)\n  Reusable building blocks with props and named slots.\n\n  ```v\n  b.use('card', CardProps{ title: 'My Card', content: b.text('Card content') })\n  ```\n\n* 🔹 **Documents** (`builder.document`)\n  Build entire HTML/XML documents with doctype, root node, and charset.\n\n  ```v\n  b.document(root_node, .html)\n  ```\n\n* 🔹 **Text \u0026 Translations** (`builder.text`)\n  Render text with optional translation support;\n  global translations can be added dynamically.\n\n  ```v\n  b.add_translation('Welcome', 'fr', 'Bienvenue')\n  b.text('Welcome')\n  ```\n\n* 🔹 **Directives** (`builder.directive`)\n  Apply behaviors or conditional logic to elements and components at runtime.\n\n* 🔹 **Functional \u0026 Runtime-first**\n  Chainable methods, minimal boilerplate, and fully runtime execution.\n\n---\n\n## 📦 Installation\n\n### Via VPM (Recommended)\n\n```sh\nv install siguici.vml\n```\n\n### Via Git\n\n```sh\nmkdir -p ${V_MODULES:-$HOME/.vmodules}/siguici\ngit clone --depth=1 https://github.com/siguici/vml ${V_MODULES:-$HOME/.vmodules}/siguici/vml\n```\n\n### As a project dependency\n\n```v\nModule {\n  dependencies: ['siguici.vml']\n}\n```\n\n---\n\n## ⚡ Example\n\n```v\nimport vml { Context, Props }\nimport veb { RawHtml }\n\nstruct HeaderProps {\n  title: string\n}\n\nmut b := vml.builder()\n\nb.add_translation('Hello World', 'fr', 'Bonjour le monde')\n\nb.add('header', fn (ctx \u0026Context, props props) {\n  if props is HeaderProps {\n    title := b.translate(props.title)\n    return $tmpl('templates/header.html')\n  }\n  eprintln('Invalid props for header')\n  return ''\n})\n\nhtml := b.document(\n  b.element('html', {}, [\n    b.element('body', {}, [\n      b.use('header', HeaderProps{ title: 'Welcome' }),\n    ])\n  ]),\n  .html\n)\n\nprintln(html)\n```\n\n---\n\n## 🛠 API Usage Overview\n\n| Method                                               | Description                           |\n| -----------------------------------------------------| ------------------------------------- |\n| `builder.element(name, attrs, contents...)`            | Create a standard element             |\n| `builder.component(name, props, slots)`                | Render a reusable component           |\n| `builder.document(root, doctype)`                      | Render a full document                |\n| `builder.text(value, params)`                          | Render text with optional translation |\n| `builder.add_translation(phrase, locale, translation)` | Add global translation                |\n| `builder.translate(phrase)`                            | Get translated phrase                 |\n\n---\n\n## 💡 Philosophy\n\n* **Runtime first**: no compilation, everything is built programmatically.\n* **Fluent API**: concise, chainable methods for faster development.\n* **Functional**: encourages composable elements, components, and slots.\n* **Global translations**: manage multilingual content seamlessly.\n\n**Not a template engine** — VML focuses on **functional runtime construction of HTML/XML**\nwith reusable components, slots, and translations.\n\n## 🤝 Contributing\n\nContributions, bug reports, and feature requests are warmly welcome!\nFeel free to open issues or pull requests.\n\n---\n\n## 📄 License\n\nDistributed under the MIT License. See `LICENSE` for details.\n\n---\n\nVML is **not a template engine**: it focuses on **functional,\nruntime construction of HTML/XML** with reusable components,\nslots, and translations.\n\n## Happy building! 🎉\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiguici%2Fvml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiguici%2Fvml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiguici%2Fvml/lists"}