{"id":19943296,"url":"https://github.com/turtleexception/fancyformat","last_synced_at":"2026-04-13T12:01:50.712Z","repository":{"id":152318942,"uuid":"576311753","full_name":"TurtleException/FancyFormat","owner":"TurtleException","description":"Simple library to translate message formats","archived":false,"fork":false,"pushed_at":"2024-05-22T21:50:17.000Z","size":731,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-03T21:49:55.675Z","etag":null,"topics":["discord","formatter","markdown","markdown-parser","minecraft","parser"],"latest_commit_sha":null,"homepage":"","language":"Java","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/TurtleException.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-12-09T14:25:21.000Z","updated_at":"2024-05-22T21:50:21.000Z","dependencies_parsed_at":"2025-09-03T21:42:19.057Z","dependency_job_id":"2128fa33-0147-4172-85da-0958d70679fb","html_url":"https://github.com/TurtleException/FancyFormat","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/TurtleException/FancyFormat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TurtleException%2FFancyFormat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TurtleException%2FFancyFormat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TurtleException%2FFancyFormat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TurtleException%2FFancyFormat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TurtleException","download_url":"https://codeload.github.com/TurtleException/FancyFormat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TurtleException%2FFancyFormat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31751705,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["discord","formatter","markdown","markdown-parser","minecraft","parser"],"created_at":"2024-11-13T00:16:05.542Z","updated_at":"2026-04-13T12:01:50.682Z","avatar_url":"https://github.com/TurtleException.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[version-shield]: https://img.shields.io/github/v/release/TurtleException/FancyFormat?include_prereleases\n[license-shield]: https://img.shields.io/github/license/TurtleException/FancyFormat\n[build-shield]: https://img.shields.io/github/actions/workflow/status/TurtleException/FancyFormat/build.yaml\n\n\u003cimg align=\"right\" src=\".github/FancyFormat.png\" height=\"200\" width=\"200\"\u003e\n\n[![version-shield]](https://github.com/TurtleException/FancyFormat/releases)\n[![license-shield]](LICENSE)\n[![build-shield]](https://github.com/TurtleException/FancyFormat/actions/workflows/build.yaml)\n\n# FancyFormat\nA simple library to translate message formats like\n[Minecraft legacy formatting codes](https://minecraft.fandom.com/wiki/Formatting_codes),\n[Minecraft JSON text format](https://minecraft.fandom.com/wiki/Raw_JSON_text_format) or\n[Discord Markdown](https://support.discord.com/hc/en-us/articles/210298617).\nThe two main goals of this project are performance and lossless translation. Sadly, the latter is not always possible\nsince different message formats have different visualization features.\n\nTo allow applications to use this library for logging a new format is introduced: The **Turtle Format** - A simple, easy\nto expand JSON-based format that supports all features that are available in one or more other supported formats. This\nnew format can be used to store messages without sacrificing information (by storing text in only one format) or using\ntoo much disk space (by storing text in all formats).\n\n### ⚠️ Work in progress ⚠️\nThis project is still in development and does not have a stable release yet.\n\nUntil then, you can use [an alpha version](https://github.com/TurtleException/FancyFormat/releases). But be advised, it is an _alpha_.\n\n## How it's done\nTo translate one message format to another, the given message \u0026 format are used to create an Abstract Syntax Tree (AST),\na data structure that can be used for syntax analysis. This is an easy way to handle messages in-memory. Each node of\nthe AST holds some information about the formatting of its children **or** is a raw text element. This makes nested\nformatting possible and easy to interpret / parse.\n\n**So, in less fancy words**, a message is converted into some data structure, which can then be used to translate the\ninitial format to some other format with minimal loss of information.\n\n## Example\nLet's say we have this message from Discord:\n\n\u003cimg src=\".github/example-discord.png\" width=\"750\"\u003e\n\nThe raw content of that message looks like this:\n```\nHey \u003c@916094119758139413\u003e, look at _this cool **formatting!**_\n```\nRegardless of what format we want to translate this message to, we first need to create the message AST. Here's a simple\nvisualization of the implementation:\n\n\u003cimg src=\".github/example-ast.png\" width=\"750\"\u003e\n\nOk, so we now can display this message in any supported format. Like, for example, the Minecraft JSON format:\n```json\n[\n  {\n    \"text\": \"Hey \"\n  },\n  {\n    \"text\":  \"@TurtleBot\",\n    \"color\": \"aqua\"\n  },\n  {\n    \"text\": \", look at \"\n  },\n  {\n    \"text\": \"this cool \",\n    \"italic\": true\n  },\n  {\n    \"text\": \"formatting!\",\n    \"bold\": true,\n    \"italic\": true\n  }\n]\n```\nOr alternatively the legacy formatting codes:\n```\nHey §b@TurtleBot§r, look at §othis cool §lformatting!\n```\nBoth of which would look like this in-game:\n\n\u003cimg src=\".github/example-minecraft.png\" width=\"750\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturtleexception%2Ffancyformat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fturtleexception%2Ffancyformat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturtleexception%2Ffancyformat/lists"}