{"id":13535174,"url":"https://github.com/johngarrett/HyperSwift","last_synced_at":"2025-04-02T00:32:45.425Z","repository":{"id":40364384,"uuid":"280538618","full_name":"johngarrett/HyperSwift","owner":"johngarrett","description":"A Swift DSL for generating HTML and CSS documents","archived":false,"fork":false,"pushed_at":"2022-05-12T18:40:04.000Z","size":80,"stargazers_count":49,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T06:33:40.742Z","etag":null,"topics":["dsl","html","swift","swiftpm"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johngarrett.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}},"created_at":"2020-07-17T22:44:15.000Z","updated_at":"2025-02-08T06:27:19.000Z","dependencies_parsed_at":"2022-08-09T18:23:01.696Z","dependency_job_id":null,"html_url":"https://github.com/johngarrett/HyperSwift","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johngarrett%2FHyperSwift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johngarrett%2FHyperSwift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johngarrett%2FHyperSwift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johngarrett%2FHyperSwift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johngarrett","download_url":"https://codeload.github.com/johngarrett/HyperSwift/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246735354,"owners_count":20825221,"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":["dsl","html","swift","swiftpm"],"created_at":"2024-08-01T08:00:50.774Z","updated_at":"2025-04-02T00:32:45.025Z","avatar_url":"https://github.com/johngarrett.png","language":"Swift","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"## HyperSwift - a HTML and CSS Generator\n[![Swift 5.2](https://img.shields.io/badge/swift-5.2-ED523F.svg?style=flat)](https://swift.org/download/)\n[![@garrepi](https://img.shields.io/badge/contact-@garrepi-73c5ff.svg?style=flat)](https://twitter.com/garrepi)\n\n#### About\nHyperSwift (name pending) is a DSL written purely in Swift aimed to generate HTML styled with CSS.\n#### Main Features\n- Vertical and Horizontal stack wrappers\n- Native HTML Elements\n- CSS Stylesheet generation\n#### Code Snippits\n505 Page from [garrepi.dev](https://www.garrepi.dev):\n```swift\nimport HyperSwift\n\nVStack(justify: .center, align: .center) {\n  HStack(justify: .spaceEvenly, align: .center) {\n    Image(url: \"/images/error_bomb.png\")\n      .width(100)\n      .height(100)\n    Header(.header3) { \"HTTP 500\" }\n      .font(weight: \"bold\", size: 40, family: \"SF Mono\")\n  }          \n  Paragraph(fiveOfiveMessage)\n}\n.backgroundColor(GColors.lightRed)\n.textAlign(.center)\n.margin(5, .percent)\n.display(.flex)\n.shadow(x: 20, y: 30, color: GColors.cardShadow)\n.border(width: 1, color: .black)\n```\n![output](https://media.discordapp.net/attachments/732426870100066455/733822598504513566/unknown.png)\n\n#### CSS\n\nTo add CSS to the stylesheet, you have to call one of the functions defined in [CSSExtensions.swift](/Sources/HyperSwift/API/CSS/CSSExtensions.swift).  \nIf an element has a class name, the styles will automatically be added to [CSSStyleSheet.swift](/Sources/HyperSwift/API/CSS/CSSStyleSheet.swift)'s stylesheet.  \nCalling `.generateStyleSheet()` on [CSSStyleSheet.swift](/Sources/HyperSwift/API/CSS/CSSStyleSheet.swift) will return a string containing the stylesheet.\n\n#### Examples\n\nHyperSwift is being used on [garrepi.dev](https://www.garrepi.dev) as we speak! Checkout the source code [here](https://github.com/johngarrett/garrepi.dev/). \n\n#### Usage\n\nin your `Package.swift`: \n```swift\n. . .\n.package(url: \"https://github.com/johngarrett/HyperSwift\", .branch(\"main\")),\n. . .\n```\n\n#### Contributing\n\nI would _love_ help with this -- there's a lot that needs to get done. \n\nI have little free time and an even little-er ability to focus on one project. Feel free to send in a PR with ideas, suggestions, or actual code!\n\nreach out to me on [twitter](https://twitter.com/garrepi) if you have questions I can answer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohngarrett%2FHyperSwift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohngarrett%2FHyperSwift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohngarrett%2FHyperSwift/lists"}