{"id":23302270,"url":"https://github.com/fjebaker/tisch","last_synced_at":"2025-09-01T12:37:21.291Z","repository":{"id":268071556,"uuid":"625258809","full_name":"fjebaker/tisch","owner":"fjebaker","description":"Table printing utilities.","archived":false,"fork":false,"pushed_at":"2023-04-08T19:53:55.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-25T11:10:02.136Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Zig","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/fjebaker.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-08T14:58:13.000Z","updated_at":"2023-04-08T14:58:50.000Z","dependencies_parsed_at":"2024-12-14T04:43:30.707Z","dependency_job_id":"c34ca567-89f1-4eb1-9ea8-eb3a77c27d93","html_url":"https://github.com/fjebaker/tisch","commit_stats":null,"previous_names":["fjebaker/tisch"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fjebaker/tisch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fjebaker%2Ftisch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fjebaker%2Ftisch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fjebaker%2Ftisch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fjebaker%2Ftisch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fjebaker","download_url":"https://codeload.github.com/fjebaker/tisch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fjebaker%2Ftisch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273123730,"owners_count":25049868,"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","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-12-20T10:28:33.539Z","updated_at":"2025-09-01T12:37:21.270Z","avatar_url":"https://github.com/fjebaker.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tisch\n\n\u003e Using bad code saves you from writing bad code.\n\nTable printing utilities for command line tools.\n\n## Examples\n\nDefault with `tisch.Table`:\n\n```zig\nvar str = try table.toString(.{});\n```\n\n```\n┌─────────┬─────┬─────────┐\n│Heading 1│  2  │Heading 3│\n├─────────┼─────┼─────────┤\n│a        │b    │c        │\n│1        │2    │3        │\n│hello    │world│!        │\n└─────────┴─────┴─────────┘\n```\n\nWith padding:\n\n```zig\nvar str = try table.toString(.{\n    .padding = .{ .l = 3, .r = 2 },\n});\n```\n\n```\n┌──────────────┬──────────┬──────────────┐\n│   Heading 1  │     2    │   Heading 3  │\n├──────────────┼──────────┼──────────────┤\n│   a          │   b      │   c          │\n│   1          │   2      │   3          │\n│   hello      │   world  │   !          │\n└──────────────┴──────────┴──────────────┘\n```\n\nAlignment:\n\n```zig\nvar str = try table.toString(.{\n    .padding = .{ .l = 1, .r = 1 },\n    .alignment = .Right,\n});\n```\n\n```\n┌───────────┬───────┬───────────┐\n│ Heading 1 │   2   │ Heading 3 │\n├───────────┼───────┼───────────┤\n│         a │     b │         c │\n│         1 │     2 │         3 │\n│     hello │ world │         ! │\n└───────────┴───────┴───────────┘\n```\n\nEqual widths:\n\n```zig\nvar str = try table.toString(.{\n    .padding = .{ .l = 1, .r = 1 },\n    .even = true,\n});\n```\n\n```\n┌───────────┬───────────┬───────────┐\n│ Heading 1 │     2     │ Heading 3 │\n├───────────┼───────────┼───────────┤\n│ a         │ b         │ c         │\n│ 1         │ 2         │ 3         │\n│ hello     │ world     │ !         │\n└───────────┴───────────┴───────────┘\n```\n\nOutlines:\n\n```zig\nvar str = try table.toString(.{\n    .padding = .{ .l = 1, .r = 1 },\n    .even = true,\n    .outline = false,\n});\n```\n\n```\n─────────────────────────────────────\n  Heading 1       2       Heading 3\n─────────────────────────────────────\n  a           b           c\n  1           2           3\n  hello       world       !\n─────────────────────────────────────\n```\n\nNo rule lines at all:\n\n```zig\nvar str = try table.toString(.{\n    .padding = .{ .l = 1, .r = 1 },\n    .outline = false,\n    .rule = false,\n});\n```\n\n```\n  Heading 1     2     Heading 3\n  a           b       c\n  1           2       3\n  hello       world   !\n```\n\nAdd indexes:\n\n```zig\nvar str = try table.toString(.{\n    .padding = .{ .l = 1, .r = 1 },\n    .index = true,\n    .index_str = \"Index\",\n});\n```\n\n```\n┌───────┬───────────┬───────┬───────────┐\n│ Index │ Heading 1 │   2   │ Heading 3 │\n├───────┼───────────┼───────┼───────────┤\n│ 1     │ a         │ b     │ c         │\n│ 2     │ 1         │ 2     │ 3         │\n│ 3     │ hello     │ world │ !         │\n└───────┴───────────┴───────┴───────────┘\n```\n\nPure ASCII:\n\n```zig\nvar table = try AsciiTable.initWithHeadings(...)\n// ...\nvar str = try table.toString(.{\n    .padding = .{ .l = 1, .r = 1 },\n});\n```\n\n```\n+-------+-----------+-------+-----------+\n| Index | Heading 1 |   2   | Heading 3 |\n+-------+-----------+-------+-----------+\n| 1     | a         | b     | c         |\n| 2     | 1         | 2     | 3         |\n| 3     | hello     | world | !         |\n+-------+-----------+-------+-----------+\n```\n\n## Usage\n\nAdd the project as a zig dependency in your `build.zig.zon` and add the module to your project.\n\nInitialize a table with some headings, and then add as many rows as you need. Rows are simply `[][]const u8`, which are copied by the table.\n\n```zig\nconst tisch = @import(\"tisch\");\nconst Table = tisch.Table;\n\n\nvar headings = [_][]const u8{ \"Heading 1\", \"2\", \"Heading 3\" };\nvar table = try Table.initWithHeadings(allocator, \u0026headings);\ndefer table.deinit();\n\nvar row1 = [_][]const u8{ \"a\", \"b\", \"c\" };\ntry table.addRow(\u0026row1);\nvar row2 = [_][]const u8{ \"1\", \"2\", \"3\" };\ntry table.addRow(\u0026row2);\nvar row3 = [_][]const u8{ \"hello\", \"world\", \"!\" };\ntry table.addRow(\u0026row3);\n\n// print options\nvar str = try table.toString(\n    .{\n        .alignment = .Right,\n        .even = false,\n        .outline = true,\n        .rule = true,\n        .padding = .{ .r = 2, .l = 2 },\n        .index = false,\n    },\n);\ndefer allocator.free(str);\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffjebaker%2Ftisch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffjebaker%2Ftisch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffjebaker%2Ftisch/lists"}