{"id":18460168,"url":"https://github.com/cldfire/mc-legacy-formatting","last_synced_at":"2025-08-03T04:34:29.962Z","repository":{"id":47318523,"uuid":"305561410","full_name":"Cldfire/mc-legacy-formatting","owner":"Cldfire","description":"A non-allocating parser for Minecraft's legacy formatting system","archived":false,"fork":false,"pushed_at":"2023-04-16T22:43:54.000Z","size":3804,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-03T04:34:00.931Z","etag":null,"topics":["codes","formatting","minecraft","parser","vanilla"],"latest_commit_sha":null,"homepage":"https://cldfire.github.io/mc-legacy-formatting/","language":"Rust","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/Cldfire.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2020-10-20T01:53:59.000Z","updated_at":"2022-02-06T02:48:22.000Z","dependencies_parsed_at":"2024-11-06T08:29:02.351Z","dependency_job_id":null,"html_url":"https://github.com/Cldfire/mc-legacy-formatting","commit_stats":{"total_commits":52,"total_committers":3,"mean_commits":"17.333333333333332","dds":0.25,"last_synced_commit":"e5828efdc8870698b8d674af7ddeda03d177f2f6"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/Cldfire/mc-legacy-formatting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cldfire%2Fmc-legacy-formatting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cldfire%2Fmc-legacy-formatting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cldfire%2Fmc-legacy-formatting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cldfire%2Fmc-legacy-formatting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cldfire","download_url":"https://codeload.github.com/Cldfire/mc-legacy-formatting/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cldfire%2Fmc-legacy-formatting/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268495891,"owners_count":24259397,"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-08-03T02:00:12.545Z","response_time":2577,"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":["codes","formatting","minecraft","parser","vanilla"],"created_at":"2024-11-06T08:25:49.317Z","updated_at":"2025-08-03T04:34:29.941Z","avatar_url":"https://github.com/Cldfire.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mc-legacy-formatting\n\n[![Docs.rs docs](https://docs.rs/mc-legacy-formatting/badge.svg)](https://docs.rs/mc-legacy-formatting)\n[![Crates.io version](https://img.shields.io/crates/v/mc-legacy-formatting.svg)](https://crates.io/crates/mc-legacy-formatting)\n[![Crates.io downloads](https://img.shields.io/crates/d/mc-legacy-formatting.svg)](https://crates.io/crates/mc-legacy-formatting)\n![CI](https://github.com/Cldfire/mc-legacy-formatting/workflows/CI/badge.svg)\n[![dependency status](https://deps.rs/repo/github/cldfire/mc-legacy-formatting/status.svg)](https://deps.rs/repo/github/cldfire/mc-legacy-formatting)\n\nA parser for Minecraft's [legacy formatting system][legacy_fmt], created\nwith careful attention to the quirks of the vanilla client's implementation.\n\n[Try it online!](https://cldfire.github.io/mc-legacy-formatting/)\n\n## Features\n\n* Iterator-based, non-allocating parser\n* Supports `#![no_std]` usage (with `default-features` set to `false`)\n* Implements the entire spec as well as vanilla client quirks (such as handling\n  of whitespace with the `STRIKETHROUGH` style)\n* Helpers for pretty-printing the parsed `Span`s to the terminal\n* Support for parsing any start character for the formatting codes (vanilla\n  uses `§` while many community tools use `\u0026`)\n\n## Examples\n\nUsing `SpanIter`:\n\n```rust\nuse mc_legacy_formatting::{SpanExt, Span, Color, Styles};\n\nlet s = \"§4This will be dark red §oand italic\";\nlet mut span_iter = s.span_iter();\n\nassert_eq!(span_iter.next().unwrap(), Span::new_styled(\"This will be dark red \", Color::DarkRed, Styles::empty()));\nassert_eq!(span_iter.next().unwrap(), Span::new_styled(\"and italic\", Color::DarkRed, Styles::ITALIC));\nassert!(span_iter.next().is_none());\n```\n\nWith a custom start character:\n\n```rust\nuse mc_legacy_formatting::{SpanExt, Span, Color, Styles};\n\nlet s = \"\u00266It's a lot easier to type \u0026b\u0026 \u00266than \u0026b§\";\nlet mut span_iter = s.span_iter().with_start_char('\u0026');\n\nassert_eq!(span_iter.next().unwrap(), Span::new_styled(\"It's a lot easier to type \", Color::Gold, Styles::empty()));\nassert_eq!(span_iter.next().unwrap(), Span::new_styled(\"\u0026 \", Color::Aqua, Styles::empty()));\nassert_eq!(span_iter.next().unwrap(), Span::new_styled(\"than \", Color::Gold, Styles::empty()));\nassert_eq!(span_iter.next().unwrap(), Span::new_styled(\"§\", Color::Aqua, Styles::empty()));\nassert!(span_iter.next().is_none());\n```\n\n### `editor-gui`\n\nThe [editor-gui](./editor-gui) folder contains a small Rust GUI program built on top of [egui](https://github.com/emilk/egui). This program runs both natively and on the web, providing a side-by-side editor experience that allows you to enter text using legacy format codes (prefixed by `\u0026`) and instantly see the formatted output on the right-hand side.\n\n[Try it online](https://cldfire.github.io/mc-legacy-formatting/) or see the [editor-gui README file](./editor-gui/README.md) for instructions on building it locally.\n\n![screenshot of the editor-gui running natively and in a web browser side-by-side](./editor-gui/screenshot.png)\n\n## MSRV\n\nThe Minimum Supported Rust Version is currently 1.56.0. This will be bumped to the latest stable version of Rust when needed.\n\n#### License\n\n\u003csup\u003e\nLicensed under either of \u003ca href=\"LICENSE-APACHE\"\u003eApache License, Version\n2.0\u003c/a\u003e or \u003ca href=\"LICENSE-MIT\"\u003eMIT license\u003c/a\u003e at your option.\n\u003c/sup\u003e\n\n\u003cbr\u003e\n\n\u003csub\u003e\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in this crate by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n\u003c/sub\u003e\n\n[legacy_fmt]: https://wiki.vg/Chat#Colors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcldfire%2Fmc-legacy-formatting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcldfire%2Fmc-legacy-formatting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcldfire%2Fmc-legacy-formatting/lists"}