{"id":51411782,"url":"https://github.com/excelano/klartext","last_synced_at":"2026-07-04T15:05:14.675Z","repository":{"id":365328801,"uuid":"1271596726","full_name":"excelano/klartext","owner":"excelano","description":"Shared Swift package for email content: HTML-to-text, quote/seam detection, signatures, and attachment classification. Content only, never fetches. Used by Blick and Zirbe.","archived":false,"fork":false,"pushed_at":"2026-06-24T03:21:40.000Z","size":92,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-24T05:15:20.174Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/excelano.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":"2026-06-16T20:30:51.000Z","updated_at":"2026-06-24T03:21:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/excelano/klartext","commit_stats":null,"previous_names":["excelano/klartext"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/excelano/klartext","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/excelano%2Fklartext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/excelano%2Fklartext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/excelano%2Fklartext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/excelano%2Fklartext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/excelano","download_url":"https://codeload.github.com/excelano/klartext/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/excelano%2Fklartext/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35125771,"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-07-04T02:00:05.987Z","response_time":113,"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":[],"created_at":"2026-07-04T15:05:14.066Z","updated_at":"2026-07-04T15:05:14.634Z","avatar_url":"https://github.com/excelano.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Klartext\n\nA Swift package for displaying already-fetched email faithfully. It ships two\nlibraries:\n\n- **Klartext** — turns a raw email body into clean, display-ready pieces: HTML\n  reduced to readable text, the new message separated from quoted history,\n  signatures split out, and attachments classified. Cross-platform, pure\n  string and DOM work, no UI.\n- **KlartextUI** — iOS-only drop-in SwiftUI views that render a parsed body the\n  way the sender intended: `EmailHTMLView` (a faithful WKWebView render, force\n  light, remote content gated off by default, `cid:` inline images served on\n  device) and `EmailTextView` (a native fold of visible text, quoted history,\n  and signature). Depends on Klartext; built on top of it.\n\nBoth are shared by two apps with deliberately different feels — **Blick** (a\nMicrosoft 365 companion) and **Zirbe** (a Messages-style email client) — and are\nthe common floor of email display they both stand on.\n\n## The one rule\n\n**Klartext handles email content and display. It never fetches email.** Transport\n(Microsoft Graph, IMAP/MIME), authentication, and threading stay in each app. The\napp fetches a message and hands the toolkit structured values; the toolkit returns\nclean pieces (Klartext) and drop-in views (KlartextUI). The package opens no socket\nand touches no token. KlartextUI's render blocks remote content by default — loading\nit is the consuming app's explicit opt-in — while `cid:` inline images are painted\nfrom on-device bytes, introducing no new external destination.\n\n## Public API\n\nParsing, from `import Klartext`:\n\n```swift\nlet parsed = Klartext.parse(plainText: text, html: html, attachments: parts)\nparsed.visible        // the new content\nparsed.quoted         // history below the seam, if any\nparsed.signature      // separated signature, if any\nparsed.attachments    // resolved, with accurate inline classification\nparsed.preview()      // an aggressively cleaned single-glance gist\n\nKlartext.plainText(fromHTML:)   // HTML → readable text\nKlartext.replyQuoteTrailer(...) // \"On \u003cdate\u003e, \u003csender\u003e wrote:\" + quoted lines\n```\n\nRendering, from `import KlartextUI` (re-exports Klartext, so this is the only\nimport a view needs):\n\n```swift\n// Fill EmailContent from your own transport, then drop in a view.\nlet content = EmailContent(html: html, plainText: text, parts: parts)\n\nEmailHTMLView(content: content, allowRemoteContent: false) // faithful web render\nEmailTextView(content: content)                            // native fold\n```\n\n## Design\n\nThe full design, vocabulary, marker tables, and migration map live in\n[`DESIGN.md`](DESIGN.md).\n\n## Dependency and privacy\n\nOne third-party dependency: [SwiftSoup](https://github.com/scinfu/SwiftSoup)\n(MIT), used only for HTML parsing and fully encapsulated — no SwiftSoup type\ncrosses the public API, so a consumer never imports it. KlartextUI additionally\nuses WebKit and SwiftUI, both system frameworks, no third party. There is no\nnetwork, telemetry, or off-device logging anywhere in the package; the only\nnetwork a consumer can trigger is KlartextUI loading remote images, and only\nafter explicitly opting in with `allowRemoteContent`.\n\n## Requirements\n\nKlartext (parsing) is cross-platform and runs anywhere Swift does. KlartextUI\n(rendering) is iOS 17+. Add via Swift Package Manager and pin to a tagged\nrelease; import `Klartext` for parsing only, or `KlartextUI` for the views.\n\n## License\n\nMIT. See [`LICENSE`](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexcelano%2Fklartext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexcelano%2Fklartext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexcelano%2Fklartext/lists"}