{"id":17558127,"url":"https://github.com/fractaledmind/hyperspeed","last_synced_at":"2025-03-29T09:42:05.236Z","repository":{"id":56877088,"uuid":"231262852","full_name":"fractaledmind/hyperspeed","owner":"fractaledmind","description":"Create HTML in Ruby at hyperspeed.","archived":false,"fork":false,"pushed_at":"2020-06-29T16:08:34.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-04T00:41:32.529Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fractaledmind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-01T20:52:06.000Z","updated_at":"2020-06-29T16:08:36.000Z","dependencies_parsed_at":"2022-08-20T22:00:33.414Z","dependency_job_id":null,"html_url":"https://github.com/fractaledmind/hyperspeed","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fractaledmind%2Fhyperspeed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fractaledmind%2Fhyperspeed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fractaledmind%2Fhyperspeed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fractaledmind%2Fhyperspeed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fractaledmind","download_url":"https://codeload.github.com/fractaledmind/hyperspeed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246168097,"owners_count":20734389,"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":[],"created_at":"2024-10-21T09:43:19.069Z","updated_at":"2025-03-29T09:42:05.219Z","avatar_url":"https://github.com/fractaledmind.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hyperspeed\n\n## For writing Hypertext at speed in Ruby\n\nUnlike other Ruby interfaces for generating HTML, `hyperspeed` works with a simple Hash abstract syntax tree until the very last moment, allowing you to write helpers and objects that transform and compose your HTML partials. `hyperspeed` also provides a terse and lightweight Ruby DSL for writing your HTML (whether partials, components, or fragments).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'hyperspeed'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install hyperspeed\n\n## Usage\n\nIf you've ever been frustrated by ERB or HAML's inability to easily compose or transform your partials/components, then `hyperspeed` is likely for you. Or, if you've simply wanted to write your markup in pure Ruby with the simplest possible methods, `hyperspeed` is here to help.\n\nThe `Hyperspeed` module provides only two methods: `define` and `render`. You may pass a block to either, in which you write HTML as if it were pure Ruby:\n\n```ruby\nHyperspeed.render do\n  form([\n    input({ type: 'text' }),\n    button({ type: 'submit' }, 'Greet'),\n    output\n  ])\nend\n\n# =\u003e \"\u003cform\u003e\u003cinput type=\\\"text\\\"\u003e\u003c/input\u003e\u003cbutton type=\\\"submit\\\"\u003eGreet\u003c/button\u003e\u003coutput\u003e\u003c/output\u003e\u003c/form\u003e\"\n```\n\nThe `Hyperspeed.define` method accepts a block and will return a Hash AST representing your markup:\n\n```ruby\nHyperspeed.define do\n  form([\n    input({ type: 'text' }),\n    button({ type: 'submit' }, 'Greet'),\n    output\n  ])\nend\n\n# =\u003e {\n#  type: :ELEMENT,\n#  tag: :form,\n#  children: [\n#    {\n#      type: :ELEMENT,\n#      tag: :input,\n#      properties: { type: \"text\" }\n#    },\n#    {\n#      type: :ELEMENT,\n#      tag: :button,\n#      properties: { type: \"submit\" },\n#      children: [\n#        {\n#          type: :TEXT,\n#          value: \"Greet\"\n#        }\n#      ]\n#    },\n#    {\n#      type: :ELEMENT,\n#      tag: :output\n#    }\n#  ]\n# }\n```\n\nThe `Hyperspeed.render` method accepts either a block or such a Hash. If it receives a block, it will delegate that block to `Hyperspeed.define`, receive the AST Hash back, and then render that AST Hash to a string. If it receives an AST Hash directly, it will simply return your markup as a string.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/hyperspeed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffractaledmind%2Fhyperspeed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffractaledmind%2Fhyperspeed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffractaledmind%2Fhyperspeed/lists"}