{"id":36575383,"url":"https://github.com/tep/terminal-decor","last_synced_at":"2026-01-12T07:29:56.175Z","repository":{"id":84608858,"uuid":"603088314","full_name":"tep/terminal-decor","owner":"tep","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-05T23:10:05.000Z","size":684,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-31T06:42:33.182Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/tep.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-02-17T15:39:45.000Z","updated_at":"2023-03-06T10:45:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"aa2f6dd1-ecd6-4f86-a70d-71bb2ebb7816","html_url":"https://github.com/tep/terminal-decor","commit_stats":{"total_commits":34,"total_committers":2,"mean_commits":17.0,"dds":0.02941176470588236,"last_synced_commit":"2df0bb8304886ce9f7eabd5bf41a90324ccb232d"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/tep/terminal-decor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tep%2Fterminal-decor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tep%2Fterminal-decor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tep%2Fterminal-decor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tep%2Fterminal-decor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tep","download_url":"https://codeload.github.com/tep/terminal-decor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tep%2Fterminal-decor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28336524,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-01-12T07:29:55.537Z","updated_at":"2026-01-12T07:29:56.170Z","avatar_url":"https://github.com/tep.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [![Mit License][mit-img]][mit] [![GitHub Release][release-img]][release] [![GoDoc][godoc-img]][godoc] [![Go Report Card][reportcard-img]][reportcard]\n# toolman.org/terminal/decor\n\nPackage decor provides facilities for decorating a string of characters with\ndisplay attributes for the current (or specified) terminal type. This is\ndone using a notation inspired by (but slightly different from) Zsh prompt\nformatting. Supported attributes are __bold__, _italic_, and/or \u003cu\u003eunderlined\u003c/u\u003e\ncharacters as well as 256-color support for foreground and background colors.\n\n## Terminal Attributes\n\nAt its basis, this package is about decorating short blurbs of text to display\nin a terminal. As a simple example, consider the following program:\n\n``` go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"toolman.org/terminal/decor\"\n)\n\nfunc main() {\n\td, err := decor.New()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinput := \"[@B@F{44}@Iuser@i@F{Orchid1}@@@F{Green3}host@f@b]\"\n\toutput, err := d.Format(input)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"\\nTERM....: %q\\n\\n\", os.Getenv(\"TERM\"))\n\tfmt.Printf(\"Input...: %q\\n\\n\", input)\n\tfmt.Printf(\"Quoted..: %q\\n\\n\", output)\n\tfmt.Printf(\"RAW.....: %s\\n\\n\", output)\n}\n```\nWhen executed, this emits output similar to the following:\n\n![Screenshot #1][ss1-img]\n\nThis shows I'm using a terminal of type `rxvt-256color`, the input I'd like to format,\na quoted representation of the formatted output for this terminal and then the output\nas rendered by the terminal itself.\n\nBelow is a quick-n-dirty chart that walks through each of the attribute markings used above:\n\n\n![Screenshot #2][ss2-img-dark]\n![Screenshot #2][ss2-img-light]\n\n\n[ss1-img]: img/image1a.png\n[ss2-img-dark]: img/ss2c-dark.png#gh-dark-mode-only\n[ss2-img-light]: img/ss2b-light.png#gh-light-mode-only\n\n[mit-img]: http://img.shields.io/badge/License-MIT-c41e3a.svg\n[mit]: https://github.com/tep/time-timetool/blob/master/LICENSE\n\n[release-img]: https://img.shields.io/github/release/tep/terminal-decor/all.svg\n[release]: https://github.com/tep/terminal-decor/releases\n\n[godoc-img]: https://pkg.go.dev/badge/toolman.org/terminal/decor?utm_source=godoc\n[godoc]: https://pkg.go.dev/toolman.org/terminal/decor\n\n[reportcard-img]: https://goreportcard.com/badge/toolman.org/terminal/decor\n[reportcard]: https://goreportcard.com/report/toolman.org/terminal/decor\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftep%2Fterminal-decor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftep%2Fterminal-decor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftep%2Fterminal-decor/lists"}