{"id":20032546,"url":"https://github.com/akicho8/html_format","last_synced_at":"2025-07-09T09:38:49.381Z","repository":{"id":56876826,"uuid":"103804929","full_name":"akicho8/html_format","owner":"akicho8","description":" A small library that easily converts various objects to HTML","archived":false,"fork":false,"pushed_at":"2023-04-16T06:51:42.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-12T18:13:18.302Z","etag":null,"topics":["activerecord","converter","formatter","html","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/akicho8.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2017-09-17T05:16:37.000Z","updated_at":"2023-03-22T03:06:52.000Z","dependencies_parsed_at":"2024-11-13T09:49:37.049Z","dependency_job_id":null,"html_url":"https://github.com/akicho8/html_format","commit_stats":{"total_commits":77,"total_committers":1,"mean_commits":77.0,"dds":0.0,"last_synced_commit":"e1be2a0960e14f8c074ef5821375c95c6ee4f3e9"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akicho8%2Fhtml_format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akicho8%2Fhtml_format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akicho8%2Fhtml_format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akicho8%2Fhtml_format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akicho8","download_url":"https://codeload.github.com/akicho8/html_format/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241464138,"owners_count":19967175,"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":["activerecord","converter","formatter","html","ruby"],"created_at":"2024-11-13T09:38:14.523Z","updated_at":"2025-03-02T05:26:42.645Z","avatar_url":"https://github.com/akicho8.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"* html_format\n\n- http://github.com/akicho8/html_format\n\n** DESCRIPTION\n\nHTML conversion of various objects easily.\nSince it is not limited as a helper of Rails, it can be used singly and anywhere.\n\n** INSTALL\n\nInstall as a standalone gem\n\n#+BEGIN_SRC shell-script\n$ gem install html_format\n#+END_SRC\n\nOr install within application using Gemfile\n\n#+BEGIN_SRC shell-script\n$ bundle add html_format\n$ bundle install\n#+END_SRC\n\n** EXAMPLES\n\n*** Using to_html is easiest\n\n#+BEGIN_SRC ruby\n#+BEGIN_SRC ruby\n# Array of Hash\n[\n  {id: 1, name: \"alice\", created_at: \"2000-01-01\"},\n  {id: 2, name: \"bob\",   created_at: \"2000-01-02\"},\n  {id: 3, name: \"carol\", created_at: \"2000-01-03\"},\n].to_html # =\u003e \"\u003cdiv class=\\\"html_format html_format_depth_0\\\"\u003e\u003ctable class=\\\"table html_format_type_array_of_hash\\\"\u003e\u003cthead\u003e\u003ctr\u003e\u003cth\u003eid\u003c/th\u003e\u003cth\u003ename\u003c/th\u003e\u003cth\u003ecreated_at\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003ealice\u003c/td\u003e\u003ctd\u003e2000-01-01\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e2\u003c/td\u003e\u003ctd\u003ebob\u003c/td\u003e\u003ctd\u003e2000-01-02\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e3\u003c/td\u003e\u003ctd\u003ecarol\u003c/td\u003e\u003ctd\u003e2000-01-03\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/div\u003e\"\n\n# Hash\n{id: 1, name: \"alice\", created_at: \"2000-01-01\"}.to_html # =\u003e \"\u003cdiv class=\\\"html_format html_format_depth_0\\\"\u003e\u003ctable class=\\\"table html_format_type_hash\\\"\u003e\u003ctr\u003e\u003cth\u003eid\u003c/th\u003e\u003ctd\u003e1\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003cth\u003ename\u003c/th\u003e\u003ctd\u003ealice\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003cth\u003ecreated_at\u003c/th\u003e\u003ctd\u003e2000-01-01\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\u003c/div\u003e\"\n\n# Array of Array\n[\n  [1, \"alice\", \"2000-01-01\"],\n  [2, \"bob\",   \"2000-01-02\"],\n  [3, \"carol\", \"2000-01-03\"],\n].to_html # =\u003e \"\u003cdiv class=\\\"html_format html_format_depth_0\\\"\u003e\u003ctable class=\\\"table html_format_type_array_of_array\\\"\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003ealice\u003c/td\u003e\u003ctd\u003e2000-01-01\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e2\u003c/td\u003e\u003ctd\u003ebob\u003c/td\u003e\u003ctd\u003e2000-01-02\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e3\u003c/td\u003e\u003ctd\u003ecarol\u003c/td\u003e\u003ctd\u003e2000-01-03\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/div\u003e\"\n\n# Array\n[0, 1, 2, 3].to_html # =\u003e \"\u003cdiv class=\\\"html_format html_format_depth_0\\\"\u003e\u003ctable class=\\\"table html_format_type_array\\\"\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003e0\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\u003ctd\u003e2\u003c/td\u003e\u003ctd\u003e3\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/div\u003e\"\n#+END_SRC\n\n*** The html_format method feels like simple_format\n\n#+BEGIN_SRC ruby    \nhtml_format(1) # =\u003e \"\u003cdiv class=\\\"html_format html_format_depth_0\\\"\u003e\u003ctable class=\\\"table html_format_type_object\\\"\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003e1\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/div\u003e\"\n#+END_SRC\n\n** How to check by visual inspection during development\n\n#+BEGIN_SRC sh\ncd test/dummy\nrails s\nopen http://localhost:3000/\n#+END_SRC\n\n** When combined with Rails and bootstrap\n\napp/assets/stylesheets/application.css\n\n#+BEGIN_SRC css\n/*\n *= require html_format/control\n */\n#+END_SRC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakicho8%2Fhtml_format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakicho8%2Fhtml_format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakicho8%2Fhtml_format/lists"}