{"id":16987220,"url":"https://github.com/yorickpeterse/inko-builder","last_synced_at":"2026-01-05T01:04:40.223Z","repository":{"id":182880172,"uuid":"668963035","full_name":"yorickpeterse/inko-builder","owner":"yorickpeterse","description":"An Inko library for generating XML and HTML","archived":false,"fork":false,"pushed_at":"2024-08-19T22:40:02.000Z","size":58,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-26T20:13:39.173Z","etag":null,"topics":["html","inko","xml"],"latest_commit_sha":null,"homepage":"https://yorickpeterse.github.io/inko-builder/","language":"Makefile","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/yorickpeterse.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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},"funding":{"github":"yorickpeterse"}},"created_at":"2023-07-21T02:53:40.000Z","updated_at":"2024-08-19T22:40:05.000Z","dependencies_parsed_at":"2023-10-15T20:09:56.044Z","dependency_job_id":"4b7b0982-5ea4-4960-bd7a-54564114ca57","html_url":"https://github.com/yorickpeterse/inko-builder","commit_stats":null,"previous_names":["yorickpeterse/inko-builder"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yorickpeterse%2Finko-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yorickpeterse%2Finko-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yorickpeterse%2Finko-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yorickpeterse%2Finko-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yorickpeterse","download_url":"https://codeload.github.com/yorickpeterse/inko-builder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244894325,"owners_count":20527677,"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","inko","xml"],"created_at":"2024-10-14T02:48:34.704Z","updated_at":"2026-01-05T01:04:40.217Z","avatar_url":"https://github.com/yorickpeterse.png","language":"Makefile","funding_links":["https://github.com/sponsors/yorickpeterse"],"categories":[],"sub_categories":[],"readme":"# Builder\n\nBuilder allows generating of XML and HTML using an Inko DSL, without the need\nfor a template engine of sorts. It's inspired by the [Ruby \"Builder\"\nproject](https://github.com/tenderlove/builder), which does the same but in\nRuby.\n\n# Requirements\n\n- Inko 0.19.0 or newer\n\n# Installation\n\n```bash\ninko pkg add github.com/yorickpeterse/inko-builder 0.16.0\ninko pkg sync\n```\n\n# Examples\n\nGenerating a simple XML document:\n\n```inko\nimport builder.xml (Document)\nimport std.stdio (STDOUT)\n\ntype async Main {\n  fn async main {\n    let out = STDOUT.new\n    let doc = Document.with(fn (doc) {\n      doc.element('person').with(fn (person) {\n        person.element('name').text('Alice')\n        person.element('city').text('Foo Town')\n      })\n    })\n\n    out.print(doc.to_pretty_string)\n  }\n}\n```\n\nThis produces the following XML:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\" ?\u003e\n\u003cperson\u003e\n  \u003cname\u003eAlice\u003c/name\u003e\n  \u003ccity\u003eFoo Town\u003c/city\u003e\n\u003c/person\u003e\n```\n\nGenerating a simple HTML document:\n\n```inko\nimport builder.html (Document)\nimport std.stdio (STDOUT)\n\ntype async Main {\n  fn async main {\n    let out = STDOUT.new\n    let doc = Document.html('en', fn (html) {\n      html.head.with(fn (head) { head.title.text('My website') })\n\n      html.body.with(fn (body) { body.p.text('Hello!') })\n    })\n\n    out.print(doc.to_pretty_string)\n  }\n}\n```\n\nThis produces the following HTML:\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003ctitle\u003eMy website\u003c/title\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cp\u003eHello!\u003c/p\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nFor more information, refer to the [API\ndocumentation](https://yorickpeterse.github.io/inko-builder/).\n\n# License\n\nAll source code in this repository is licensed under the Mozilla Public License\nversion 2.0, unless stated otherwise. A copy of this license can be found in the\nfile \"LICENSE\".\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyorickpeterse%2Finko-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyorickpeterse%2Finko-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyorickpeterse%2Finko-builder/lists"}