{"id":32151024,"url":"https://github.com/dokun1/vaux","last_synced_at":"2026-02-19T08:01:55.109Z","repository":{"id":47727652,"uuid":"190623434","full_name":"dokun1/Vaux","owner":"dokun1","description":"A HTML DSL library for Swift","archived":false,"fork":false,"pushed_at":"2020-04-21T20:07:36.000Z","size":150,"stargazers_count":601,"open_issues_count":3,"forks_count":18,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-12-22T19:43:56.756Z","etag":null,"topics":["dsl","html","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dokun1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-06T17:36:49.000Z","updated_at":"2025-11-25T18:59:32.000Z","dependencies_parsed_at":"2022-09-16T18:40:15.083Z","dependency_job_id":null,"html_url":"https://github.com/dokun1/Vaux","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/dokun1/Vaux","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dokun1%2FVaux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dokun1%2FVaux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dokun1%2FVaux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dokun1%2FVaux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dokun1","download_url":"https://codeload.github.com/dokun1/Vaux/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dokun1%2FVaux/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29608152,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T06:47:36.664Z","status":"ssl_error","status_checked_at":"2026-02-19T06:45:47.551Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["dsl","html","swift"],"created_at":"2025-10-21T10:33:01.767Z","updated_at":"2026-02-19T08:01:55.103Z","avatar_url":"https://github.com/dokun1.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Vaux\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://swift.org\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/swift-5.1-orange.svg\" alt=\"Swift Version\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://swift.org/package-manager/\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/SwiftPM-Tools:5.1-FC3324.svg?style=flat\" alt=\"Swift PM Compatible\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://choosealicense.com/licenses/apache/\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-Apache-red.svg\" alt=\"Apache License\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://travis-ci.com/mbarnach/Vaux\"/\u003e\n    \u003cimg src=\"https://travis-ci.com/mbarnach/Vaux.svg?branch=master\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/mbarnach/Vaux\"\u003e\n    \u003cimg src=\"https://codecov.io/gh/mbarnach/Vaux/branch/master/graph/badge.svg\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nVaux is a library that allows you to generate HTML using Swift. It includes a domain-specific language written in Swift for HTML, and its purpose is to allow developers to write HTML, but in Swift.\n\n**Warning**: If you are reading this, this is alpha software based on Swift 5.1, which is currently only downloadable from [swift.org](https://swift.org) or in Xcode 11 Beta. This is a work in progress in every sense of the phrase.\n\n## Requirements\n\n- Swift 5.1\n\n## Motivation\n\nAt WWDC2019, Apple announced functionality for a new feature in Swift called [Function Builders](https://github.com/rjmccall/swift-evolution/blob/function-builders/proposals/XXXX-function-builders.md). The core functionality of Vaux, which includes a Swift DSL for HTML, is heavily inspired by this proposal and corresponding examples. As such, this library exists with two primary goals:\n\n- Provide an underpinning for future potential opinionated frameworks for web interfaces written in Swift (for example, [this](https://github.com/dokun1/SwiftWebUI)).\n- Learn more about function builders.\n\nAt the time of this library's first open source release, it is standing tall on the shoulders of giants, and gratitude is in order.\n\n## Example\n\nLet's say you want to write the following HTML:\n\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003ctitle\u003e\n      Page title\n    \u003c/title\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdiv\u003e\n      Page body\n    \u003c/div\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nRather than write this out by hand, you can first write a function that will return HTML using Vaux:\n\n```swift\nvar pageTitle = \"Page title\"\nvar pageBody = \"Page body\"\n\nfunc simplePage() -\u003e HTML {\n  html {\n    head {\n      title(pageTitle)\n    }\n    body {\n      div {\n        pageBody\n      }\n    }\n  }\n}\n```\n\nThen, you can render the function result into a static html file using Vaux like so:\n\n```swift\nlet vaux = Vaux()\nvaux.outputLocation = .file(name: \"testing\", path: \"/tmp/\")\ndo {\n  try vaux.render(html)\n} catch let error {\n  print(\"Uh-oh, something happened: \\(error.localizedDescription)\")\n}\n```\n\nThe end result is that you have a file called `testing.html` in your `/tmp/` directory.\n\n## Creating HTML elements\n\n**Note**: For a series of real use cases for Vaux, check out `VauxTests.swift` to see examples of different tags.\n\nWrite a function that returns `HTML`, and add your builders inside this function:\n\n```swift\nfunc buildPage() -\u003e HTML {\n\n}\n```\n\n## Documentation\n\n_Coming soon..._\n\n## Importing This Library\n\nVaux is available as a Swift package on GitHub. If you are using the Xcode 11 beta, you can simply add this url (https://github.com/dokun1/Vaux) as a dependency. Otherwise, you must include this as a dependency in your `Package.swift` file and use the command line to to create a project for this.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdokun1%2Fvaux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdokun1%2Fvaux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdokun1%2Fvaux/lists"}