{"id":13591362,"url":"https://github.com/clj-commons/pretty","last_synced_at":"2025-12-12T01:11:57.042Z","repository":{"id":46694679,"uuid":"13689238","full_name":"clj-commons/pretty","owner":"clj-commons","description":"Library for helping print things prettily, in Clojure - ANSI fonts, formatted exceptions","archived":false,"fork":false,"pushed_at":"2025-03-28T21:38:00.000Z","size":2663,"stargazers_count":605,"open_issues_count":1,"forks_count":29,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-04-11T10:05:41.498Z","etag":null,"topics":["ansi-colors","clojure","feedback"],"latest_commit_sha":null,"homepage":"https://cljdoc.org/d/org.clj-commons/pretty","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clj-commons.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE-asl.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-10-18T20:53:32.000Z","updated_at":"2025-04-07T13:18:22.000Z","dependencies_parsed_at":"2024-03-27T20:48:38.442Z","dependency_job_id":"c408521e-817f-4c3d-9ceb-2f9243d6b282","html_url":"https://github.com/clj-commons/pretty","commit_stats":null,"previous_names":["clj-commons/pretty","avisonovate/pretty"],"tags_count":64,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clj-commons%2Fpretty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clj-commons%2Fpretty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clj-commons%2Fpretty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clj-commons%2Fpretty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clj-commons","download_url":"https://codeload.github.com/clj-commons/pretty/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837273,"owners_count":21169373,"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":["ansi-colors","clojure","feedback"],"created_at":"2024-08-01T16:00:56.612Z","updated_at":"2025-12-12T01:11:56.999Z","avatar_url":"https://github.com/clj-commons.png","language":"Clojure","funding_links":[],"categories":["Clojure"],"sub_categories":[],"readme":"[![Clojars](https://img.shields.io/clojars/v/org.clj-commons/pretty.svg)](http://clojars.org/org.clj-commons/pretty)\n[![CI](https://github.com/clj-commons/pretty/actions/workflows/clojure.yml/badge.svg)](https://github.com/clj-commons/pretty/actions/workflows/clojure.yml)\n[![cljdoc badge](https://cljdoc.org/badge/org.clj-commons/pretty)](https://cljdoc.org/d/org.clj-commons/pretty/)\n\n*Sometimes, neatness counts*\n\nIf you are trying to puzzle out a stack trace, \npick a critical line of text out of a long stream of console output,\nor compare two streams of binary data, a little bit of formatting can go a long way.\n\nThat's what `org.clj-commons/pretty` is for.  It adds support for pretty output where it counts:\n\n* Readable output for exceptions\n* General ANSI font and background color support\n* Readable output for binary sequences\n\n![Example](docs/images/formatted-exception.png)\n\n\nOr, compare an example from\n[Pedestal](http://github.com/pedestal/pedestal)'s test suite:\n\n![No Pretty](docs/images/pedestal-without-pretty.png)\n\nOr, same thing, but with Pretty enabled:\n\n![With Pretty](docs/images/pedestal-with-pretty.png)\n\nThe point is, you can scan down to see things in chronological order; the important parts are highlighted, the names are the same (or closer) to your source code, unnecessary details are omitted, and it's much easier to pick out the most important parts, such as file names and line numbers.\n\n## Beyond Exceptions\n\nPretty can print out a sequence of bytes; it includes color-coding inspired by\n[hexyl](https://github.com/sharkdp/hexyl):\n\n![Binary Output](docs/images/binary-output.png)\n\nPretty can also print out a delta of two byte sequences, using background color\nto indicate where the two sequences differ.\n\n![Binary Delta](docs/images/binary-delta.png)\n\nPretty can output pretty tabular data:\n\n```\n(print-table\n    [:method\n     :path\n     {:key :route-name :title \"Name\"}]\n    [{:method     :get\n      :path       \"/\"\n      :route-name :root-page}\n     {:method     :post\n      :path       \"/reset\"\n      :route-name :reset}\n     {:method     :get\n      :path       \"/status\"\n      :route-name :status}])\n┏━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━┓\n┃ Method ┃   Path  ┃    Name    ┃\n┣━━━━━━━━╋━━━━━━━━━╋━━━━━━━━━━━━┫\n┃   :get ┃       / ┃ :root-page ┃\n┃  :post ┃  /reset ┃ :reset     ┃\n┃   :get ┃ /status ┃ :status    ┃\n┗━━━━━━━━┻━━━━━━━━━┻━━━━━━━━━━━━┛\n=\u003e nil\n```\n\nThe `print-table` function has many options to easily adjust the output to your needs, including fonts, text alignment, and the table border.\n\n\n## Compatibility\n\nPretty is compatible with Clojure 1.10 and above.\n\nParts of Pretty can be used with [Babashka](https://book.babashka.org/#introduction), such as the `clj-commons.ansi`\nnamespace; however, Babashka runs in an interpreter and its approach to exceptions is\nincompatible with JVM exceptions.\n\n## License\n\nThe majority of this code is available under the terms of the Apache Software License 1.0; some portions\nare available under the terms of the Eclipse Public Licence 1.0.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclj-commons%2Fpretty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclj-commons%2Fpretty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclj-commons%2Fpretty/lists"}