{"id":50336193,"url":"https://github.com/YGGverse/ggemtext","last_synced_at":"2026-06-15T04:01:06.941Z","repository":{"id":258385575,"uuid":"874854806","full_name":"YGGverse/ggemtext","owner":"YGGverse","description":"Glib-oriented Gemtext API","archived":false,"fork":false,"pushed_at":"2026-05-12T07:39:46.000Z","size":68,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-05-12T09:35:10.004Z","etag":null,"topics":["gemini-protocol","gemtext","glib","gtk"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/ggemtext","language":"Rust","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/YGGverse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"custom":"https://yggverse.github.io/#donate"}},"created_at":"2024-10-18T15:26:46.000Z","updated_at":"2026-05-12T07:37:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"f6fb66cc-7434-4aa4-b5c6-d5091dab1d1b","html_url":"https://github.com/YGGverse/ggemtext","commit_stats":null,"previous_names":["yggverse/ggemtext"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/YGGverse/ggemtext","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YGGverse%2Fggemtext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YGGverse%2Fggemtext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YGGverse%2Fggemtext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YGGverse%2Fggemtext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YGGverse","download_url":"https://codeload.github.com/YGGverse/ggemtext/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YGGverse%2Fggemtext/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34346870,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"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":["gemini-protocol","gemtext","glib","gtk"],"created_at":"2026-05-29T14:00:19.060Z","updated_at":"2026-06-15T04:01:06.934Z","avatar_url":"https://github.com/YGGverse.png","language":"Rust","funding_links":["https://yggverse.github.io/#donate"],"categories":["Programming"],"sub_categories":["Graphical"],"readme":"# ggemtext\n\n![build](https://github.com/YGGverse/ggemtext/actions/workflows/build.yml/badge.svg)\n[![dependencies](https://deps.rs/repo/github/YGGverse/ggemtext/status.svg)](https://deps.rs/repo/github/YGGverse/ggemtext)\n[![documentation](https://docs.rs/ggemtext/badge.svg)](https://docs.rs/ggemtext)\n[![crates.io](https://img.shields.io/crates/v/ggemtext.svg)](https://crates.io/crates/ggemtext)\n\nGlib-oriented [Gemtext](https://geminiprotocol.net/docs/gemtext.gmi) API\n\n## Install\n\n``` bash\ncargo add ggemtext\n```\n\n## Usage\n\n* [Documentation](https://docs.rs/ggemtext/latest/)\n\n### Line\n\nLine parser, useful for [TextTag](https://docs.gtk.org/gtk4/class.TextTag.html) operations in [TextBuffer](https://docs.gtk.org/gtk4/class.TextBuffer.html) context.\n\nIterate Gemtext lines to continue with [Line](#Line) API:\n\n``` rust\nfor line in gemtext.lines() {\n    // ..\n}\n```\n\n#### Code\n\n``` rust\nuse ggemtext::line::Code;\nmatch Code::begin_from(\"```alt\") {\n    Some(mut code) =\u003e {\n        assert!(code.continue_from(\"line 1\").is_ok());\n        assert!(code.continue_from(\"line 2\").is_ok());\n        assert!(code.continue_from(\"```\").is_ok()); // complete\n\n        assert!(code.is_completed);\n        assert_eq!(code.alt, Some(\"alt\".into()));\n        assert_eq!(code.value.len(), 12 + 2); // +NL\n    }\n    None =\u003e unreachable!(),\n}\n```\n\n#### Header\n\n**Struct**\n\n``` rust\nuse ggemtext::line::{Header, header::Level};\nmatch Header::parse(\"# H1\") {\n    Some(h1) =\u003e {\n        assert_eq!(h1.level as u8, Level::H1 as u8);\n        assert_eq!(h1.value, \"H1\");\n    }\n    None =\u003e unreachable!(),\n} // H1, H2, H3\n```\n\n**Trait**\n\n``` rust\nuse ggemtext::line::header::{Gemtext, Level};\nassert_eq!(\"# H1\".as_value(), Some(\"H1\"));\nassert_eq!(\"H1\".to_source(\u0026Level::H1), \"# H1\");\n// H1, H2, H3\n```\n\n#### Link\n\n``` rust\nuse ggemtext::line::Link;\n\nconst SOURCE: \u0026str = \"=\u003e gemini://geminiprotocol.net 1965-01-19 Gemini\";\n\nlet link = Link::parse(SOURCE).unwrap();\n\nassert_eq!(link.alt, Some(\"1965-01-19 Gemini\".to_string()));\nassert_eq!(link.url, \"gemini://geminiprotocol.net\");\n\nlet uri = link.uri(None).unwrap();\nassert_eq!(uri.scheme(), \"gemini\");\nassert_eq!(uri.host().unwrap(), \"geminiprotocol.net\");\n\nlet time = link.time(Some(\u0026glib::TimeZone::local())).unwrap();\nassert_eq!(time.year(), 1965);\nassert_eq!(time.month(), 1);\nassert_eq!(time.day_of_month(), 19);\n\nassert_eq!(link.to_source(), SOURCE);\n```\n\n#### List\n\n**Struct**\n\n``` rust\nuse ggemtext::line::List;\nmatch List::parse(\"* Item\") {\n    Some(list) =\u003e assert_eq!(list.value, \"Item\"),\n    None =\u003e unreachable!(),\n}\n```\n\n**Trait**\n\n``` rust\nuse ggemtext::line::list::Gemtext;\nassert_eq!(\"* Item\".as_value(), Some(\"Item\"))\nassert_eq!(\"Item\".to_source(), \"* Item\")\n```\n\n#### Quote\n\n**Struct**\n\n``` rust\nuse ggemtext::line::Quote;\nmatch Quote::parse(\"\u003e Quote\") {\n    Some(quote) =\u003e assert_eq!(quote.value, \"Quote\"),\n    None =\u003e unreachable!(),\n}\n```\n\n**Trait**\n\n``` rust\nuse ggemtext::line::quote::Gemtext;\nassert_eq!(\"\u003e Quote\".as_value(), Some(\"Quote\"))\nassert_eq!(\"Quote\".to_source(), \"\u003e Quote\")\n```\n\n## Integrations\n\n* [Yoda](https://github.com/YGGverse/Yoda) - Browser for Gemini Protocol\n\n## See also\n\n* [ggemini](https://github.com/YGGverse/ggemini) - Glib-oriented client for Gemini Protocol","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYGGverse%2Fggemtext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYGGverse%2Fggemtext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYGGverse%2Fggemtext/lists"}