{"id":13626902,"url":"https://github.com/copper-leaf/thistle","last_synced_at":"2025-04-11T21:21:45.414Z","repository":{"id":57732848,"uuid":"364969012","full_name":"copper-leaf/thistle","owner":"copper-leaf","description":"Kotlin Multiplatform inline styling markup library","archived":false,"fork":false,"pushed_at":"2022-12-07T00:11:37.000Z","size":25800,"stargazers_count":57,"open_issues_count":6,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T21:21:36.575Z","etag":null,"topics":["android","ansi-colors","compose","compose-desktop","formatting","kotlin","kotlin-multiplatform","markup"],"latest_commit_sha":null,"homepage":"https://copper-leaf.github.io/thistle/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/copper-leaf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-06T16:14:07.000Z","updated_at":"2024-11-16T01:56:09.000Z","dependencies_parsed_at":"2023-01-24T12:32:03.120Z","dependency_job_id":null,"html_url":"https://github.com/copper-leaf/thistle","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/copper-leaf%2Fthistle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/copper-leaf%2Fthistle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/copper-leaf%2Fthistle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/copper-leaf%2Fthistle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/copper-leaf","download_url":"https://codeload.github.com/copper-leaf/thistle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480420,"owners_count":21110939,"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":["android","ansi-colors","compose","compose-desktop","formatting","kotlin","kotlin-multiplatform","markup"],"created_at":"2024-08-01T22:00:24.858Z","updated_at":"2025-04-11T21:21:45.380Z","avatar_url":"https://github.com/copper-leaf.png","language":"Kotlin","funding_links":[],"categories":["Utilities / Libraries"],"sub_categories":[],"readme":"# Thistle\n\n\u003e Kotlin multiplatform String markup library, inspired by [SRML](https://github.com/jasonwyatt/SRML). Thistle is a \n\u003e common parser which produces an AST that can be rendered to a variety of platform-specific UIs.\n\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/copper-leaf/thistle)\n![Maven Central](https://img.shields.io/maven-central/v/io.github.copper-leaf/thistle-core)\n![Kotlin Version](https://img.shields.io/badge/Kotlin-1.6.10-orange)\n\n```kotlin\n// Android\nval thistle = ThistleParser(AndroidDefaults(context))\nbinding.textView.applyStyledText(\n    thistle,\n    \"Text with {{b}}bold{{/b}} or {{foreground color=#ff0000}}red{{/foreground}} styles\"\n)\n\n\n// Compose (both Android and Desktop)\nMaterialTheme {\n    ProvideThistle {\n        StyledText(\"Text with {{b}}bold{{/b}} or {{foreground color=#ff0000}}red{{/foreground}} styles\")\n    }\n}\n\n\n// Console (ANSI codes)\nval thistle = ThistleParser(ConsoleDefaults())\nprintlnStyledText(\n    thistle,\n    \"Text with {{b}}bold{{/b}} or {{red}}red{{/red}} styles\"\n)\n```\n\n| Android   | Compose UI | Console |\n| --------- | ---------- | ------- |\n| ![sample_app](https://github.com/copper-leaf/thistle/blob/main/docs/src/orchid/resources/assets/media/sample_android.gif?raw=true) | ![sample_console](https://copper-leaf.github.io/thistle/assets/media/sample_compose.png) | ![sample_console](https://copper-leaf.github.io/thistle/assets/media/sample_console.png) |\n| [Source](https://github.com/copper-leaf/thistle/tree/main/examples/android) | [Source](https://github.com/copper-leaf/thistle/tree/main/examples/compose-desktop) | [Source](https://github.com/copper-leaf/thistle/blob/main/thistle-console/src/commonTest/kotlin/com/copperleaf/thistle/console/TestConsoleRenderer.kt) | \n\n# Supported Platforms/Features\n\n| Platform   | Markup Target                                                                                              |\n| ---------- | ---------------------------------------------------------------------------------------------------------- |\n| Android    | [Spannable](https://developer.android.com/reference/android/text/Spannable)                                |\n| Compose UI | [AnnotatedString](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString) |\n| Console    | [ANSI Codes](https://en.wikipedia.org/wiki/ANSI_escape_code)                                               |\n| iOS        | NSAttributedString (TODO)   |\n| JS         | HTML DOM (TODO)             |\n\n# Installation\n\n```kotlin\nrepositories {\n    mavenCentral()\n}\n\n// for plain JVM or Android projects\ndependencies {\n    implementation(\"io.github.copper-leaf:thistle-core:{{site.version}}\")\n    implementation(\"io.github.copper-leaf:thistle-android:{{site.version}}\")\n    implementation(\"io.github.copper-leaf:thistle-compose-ui:{{site.version}}\")\n    implementation(\"io.github.copper-leaf:thistle-console:{{site.version}}\")\n}\n\n// for multiplatform projects\nkotlin {\n    sourceSets {\n        val commonMain by getting {\n            dependencies {\n                implementation(\"io.github.copper-leaf:thistle-core:{{site.version}}\")\n                implementation(\"io.github.copper-leaf:thistle-android:{{site.version}}\")\n                implementation(\"io.github.copper-leaf:thistle-compose-ui:{{site.version}}\")\n                implementation(\"io.github.copper-leaf:thistle-console:{{site.version}}\")\n            }\n        }\n    }\n}\n```\n\n# Documentation\n\nSee the [website](https://copper-leaf.github.io/thistle/) for detailed documentation and usage instructions.\n\n# License \n\nThistle is licensed under the BSD 3-Clause License, see [LICENSE.md](https://github.com/copper-leaf/thistle/tree/main/LICENSE.md). \n\n# References\n\n- [SRML](https://github.com/jasonwyatt/SRML)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcopper-leaf%2Fthistle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcopper-leaf%2Fthistle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcopper-leaf%2Fthistle/lists"}