{"id":15287018,"url":"https://github.com/akicho8/org_tp","last_synced_at":"2025-10-07T01:31:06.861Z","repository":{"id":56887020,"uuid":"99424226","full_name":"akicho8/org_tp","owner":"akicho8","description":"OrgTp shows text table like emacs org-table for easy reading.","archived":true,"fork":false,"pushed_at":"2018-06-27T08:08:47.000Z","size":69,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-25T16:43:18.298Z","etag":null,"topics":["debug","emacs","formatter","org-table","ruby","table"],"latest_commit_sha":null,"homepage":"","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/akicho8.png","metadata":{"files":{"readme":"README.org","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":"2017-08-05T13:23:46.000Z","updated_at":"2023-01-28T18:59:13.000Z","dependencies_parsed_at":"2022-08-21T00:20:26.922Z","dependency_job_id":null,"html_url":"https://github.com/akicho8/org_tp","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akicho8%2Forg_tp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akicho8%2Forg_tp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akicho8%2Forg_tp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akicho8%2Forg_tp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akicho8","download_url":"https://codeload.github.com/akicho8/org_tp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235575693,"owners_count":19012156,"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":["debug","emacs","formatter","org-table","ruby","table"],"created_at":"2024-09-30T15:23:51.588Z","updated_at":"2025-10-07T01:31:06.531Z","avatar_url":"https://github.com/akicho8.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+html: \u003ca href=\"https://badge.fury.io/rb/org_tp\"\u003e\u003cimg src=\"https://badge.fury.io/rb/org_tp.svg\" alt=\"Gem Version\" height=\"18\"\u003e\u003c/a\u003e\n#+html: \u003ca href=\"https://travis-ci.org/akicho8/org_tp\"\u003e\u003cimg src=\"https://travis-ci.org/akicho8/org_tp.svg?branch=master\" /\u003e\u003c/a\u003e\n#+html: \u003ca href=\"https://codeclimate.com/github/akicho8/org_tp/maintainability\"\u003e\u003cimg src=\"https://api.codeclimate.com/v1/badges/3af6a246ec61ddafd45d/maintainability\" /\u003e\u003c/a\u003e\n\n* OrgTp\n\n  OrgTp shows text table like emacs org-table for easy reading.\n\n#+BEGIN_SRC ruby\ntp Object.constants.grep(/RUBY_/).map { |e| [e, Object.const_get(e)] }.to_h\n\n# \u003e\u003e |---------------------+------------------------------------------------------------|\n# \u003e\u003e |        RUBY_VERSION | 2.5.0                                                      |\n# \u003e\u003e |   RUBY_RELEASE_DATE | 2017-12-25                                                 |\n# \u003e\u003e |       RUBY_PLATFORM | x86_64-darwin16                                            |\n# \u003e\u003e |     RUBY_PATCHLEVEL | 0                                                          |\n# \u003e\u003e |    RUBY_DESCRIPTION | ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16] |\n# \u003e\u003e |         RUBY_ENGINE | ruby                                                       |\n# \u003e\u003e |       RUBY_REVISION | 61468                                                      |\n# \u003e\u003e | RUBY_ENGINE_VERSION | 2.5.0                                                      |\n# \u003e\u003e |      RUBY_COPYRIGHT | ruby - Copyright (C) 1993-2017 Yukihiro Matsumoto          |\n# \u003e\u003e |---------------------+------------------------------------------------------------|\n#+END_SRC\n\n** Installation\n\nInstall as a standalone gem\n\n#+BEGIN_SRC shell-script\n$ gem install org_tp\n#+END_SRC\n\nOr install within application using Gemfile\n\n#+BEGIN_SRC shell-script\n$ bundle add org_tp\n$ bundle install\n#+END_SRC\n\n** Examples\n\n*** Array of hash\n\n#+BEGIN_SRC ruby\ntp [{id: 1, name: 'alice'}, {id: 2, name: 'bob'}]\n# \u003e\u003e |----+-------|\n# \u003e\u003e | id | name  |\n# \u003e\u003e |----+-------|\n# \u003e\u003e |  1 | alice |\n# \u003e\u003e |  2 | bob   |\n# \u003e\u003e |----+-------|\n#+END_SRC\n\n*** Hash\n\n#+BEGIN_SRC ruby\ntp({id: 1, name: 'alice'})\n# \u003e\u003e |------+-------|\n# \u003e\u003e |   id | 1     |\n# \u003e\u003e | name | alice |\n# \u003e\u003e |------+-------|\n#+END_SRC\n\n*** Array\n\n#+BEGIN_SRC ruby\ntp [:alice, :bob]\n# \u003e\u003e |-------|\n# \u003e\u003e | alice |\n# \u003e\u003e | bob   |\n# \u003e\u003e |-------|\n#+END_SRC\n\n*** ActiveRecord or Mongoid\n\n#+BEGIN_SRC ruby\n['alice', 'bob'].each { |e| User.create!(name: e) }\n#+END_SRC\n\n#+BEGIN_SRC ruby\ntp User\n# \u003e\u003e |----+-------|\n# \u003e\u003e | id | name  |\n# \u003e\u003e |----+-------|\n# \u003e\u003e |  1 | alice |\n# \u003e\u003e |  2 | bob   |\n# \u003e\u003e |----+-------|\n#+END_SRC\n\n#+BEGIN_SRC ruby\ntp User.limit(1)\n# \u003e\u003e |----+-------|\n# \u003e\u003e | id | name  |\n# \u003e\u003e |----+-------|\n# \u003e\u003e |  1 | alice |\n# \u003e\u003e |----+-------|\n#+END_SRC\n\n#+BEGIN_SRC ruby\ntp User.first\n# \u003e\u003e |------+-------|\n# \u003e\u003e |   id | 1     |\n# \u003e\u003e | name | alice |\n# \u003e\u003e |------+-------|\n#+END_SRC\n\n**** ActiveRecord::Result\n\n#+BEGIN_SRC ruby\ntp ActiveRecord::Base.connection.select_all('SELECT * FROM users')\n# \u003e\u003e |----+-------|\n# \u003e\u003e | id | name  |\n# \u003e\u003e |----+-------|\n# \u003e\u003e |  1 | alice |\n# \u003e\u003e |  2 | bob   |\n# \u003e\u003e |----+-------|\n#+END_SRC\n\n** How to table as string\n\nUse to_t method.\n\n#+BEGIN_SRC ruby\nputs [{id: 1, name: 'alice'}, {id: 2, name: 'bob'}].to_t\n# \u003e\u003e |----+-------|\n# \u003e\u003e | id | name  |\n# \u003e\u003e |----+-------|\n# \u003e\u003e |  1 | alice |\n# \u003e\u003e |  2 | bob   |\n# \u003e\u003e |----+-------|\n#+END_SRC\n\n** Options\n\nPass as the second argument to tp or the first argument to to_t.\n\n#+BEGIN_SRC ruby\ntp 1\n# \u003e\u003e |---|\n# \u003e\u003e | 1 |\n# \u003e\u003e |---|\n\ntp 1, intersection_both: '+'\n# \u003e\u003e +---+\n# \u003e\u003e | 1 |\n# \u003e\u003e +---+\n#+END_SRC\n\n*** Markdown format example\n\n=markdown: true= has the same meaning as =intersection: '|', cover: false=\n\n#+BEGIN_SRC ruby\ntp [{id: 1, name: 'alice'}, {id: 2, name: 'bob'}], markdown: true\n# \u003e\u003e | id | name  |\n# \u003e\u003e |----|-------|\n# \u003e\u003e |  1 | alice |\n# \u003e\u003e |  2 | bob   |\n#+END_SRC\n\n#+BEGIN_SRC ruby\ntp [{id: 1, name: 'alice'}, {id: 2, name: 'bob'}], intersection: '|', cover: false\n# \u003e\u003e | id | name  |\n# \u003e\u003e |----|-------|\n# \u003e\u003e |  1 | alice |\n# \u003e\u003e |  2 | bob   |\n#+END_SRC\n\n** Global Options\n\n#+BEGIN_SRC ruby\ntp OrgTp.default_options\n# \u003e\u003e |-------------------+-------|\n# \u003e\u003e |          markdown | false |\n# \u003e\u003e |            header |       |\n# \u003e\u003e |             cover | true  |\n# \u003e\u003e |          vertical | |     |\n# \u003e\u003e |      intersection | +     |\n# \u003e\u003e | intersection_both | |     |\n# \u003e\u003e |           horizon | -     |\n# \u003e\u003e |           padding |       |\n# \u003e\u003e |           in_code | UTF-8 |\n# \u003e\u003e |-------------------+-------|\n\ntp 1\n# \u003e\u003e |---|\n# \u003e\u003e | 1 |\n# \u003e\u003e |---|\n\nOrgTp.default_options[:intersection_both] = '+'\n\ntp 1\n# \u003e\u003e +---+\n# \u003e\u003e | 1 |\n# \u003e\u003e +---+\n#+END_SRC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakicho8%2Forg_tp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakicho8%2Forg_tp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakicho8%2Forg_tp/lists"}