{"id":13607205,"url":"https://github.com/SnipMeDev/KodeView","last_synced_at":"2025-04-12T11:31:46.948Z","repository":{"id":178022021,"uuid":"658419623","full_name":"SnipMeDev/KodeView","owner":"SnipMeDev","description":"Kotlin Multiplatform syntax highlighting views","archived":false,"fork":false,"pushed_at":"2024-11-02T16:05:03.000Z","size":892,"stargazers_count":78,"open_issues_count":8,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-02T16:25:43.364Z","etag":null,"topics":["highlighting","kmm","kmm-library","kotlin-android","kotlin-library","kotlin-multiplatform","kotlin-native","syntax-highlighting"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/SnipMeDev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2023-06-25T17:29:03.000Z","updated_at":"2024-10-23T09:37:32.000Z","dependencies_parsed_at":"2024-11-02T16:20:52.995Z","dependency_job_id":"78c70e46-5bc5-4fcd-8a92-2dd52018812b","html_url":"https://github.com/SnipMeDev/KodeView","commit_stats":null,"previous_names":["snipmedev/kodeview"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnipMeDev%2FKodeView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnipMeDev%2FKodeView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnipMeDev%2FKodeView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnipMeDev%2FKodeView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SnipMeDev","download_url":"https://codeload.github.com/SnipMeDev/KodeView/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248560166,"owners_count":21124605,"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":["highlighting","kmm","kmm-library","kotlin-android","kotlin-library","kotlin-multiplatform","kotlin-native","syntax-highlighting"],"created_at":"2024-08-01T19:01:16.508Z","updated_at":"2025-04-12T11:31:46.943Z","avatar_url":"https://github.com/SnipMeDev.png","language":"Kotlin","funding_links":[],"categories":["Libraries","Kotlin"],"sub_categories":["🍎 Compose UI"],"readme":"![kodeview_banner_opaque](https://github.com/SnipMeDev/KodeView/assets/8405055/59c6a2af-1b32-4a02-998f-ecae2296363a)\n\n[![Maven Central](https://img.shields.io/maven-central/v/dev.snipme/kodeview)](https://mvnrepository.com/artifact/dev.snipme)\n[![Kotlin](https://img.shields.io/badge/kotlin-2.0.20-blue.svg?logo=kotlin)](http://kotlinlang.org)\n[![GitHub License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)\n\n# KodeView\n\nKotlin Compose Multiplatform components for syntax highlighting based on\n[Highlights](https://github.com/SnipMeDev/Highlights) library.\n\n## Preview\n\n\u003cimg width=\"1680\" alt=\"iShot_2023-09-14_08 19 21\" src=\"https://github.com/SnipMeDev/KodeView/assets/8405055/adb205e4-ea16-41f7-aacb-de1085d6d5f5\"\u003e\n\n## Installation ⬇️\n```shell\nrepositories {\n    mavenCentral()\n}\n```\n\n```shell\nimplementation(\"dev.snipme:kodeview:0.9.0\")\n```\n\n## Features ✨\n- CodeTextView\n- CodeEditText\n- Code component analysis (Keyword, comment, etc.)\n- Multiple syntax languages (Java, Swift, Kotlin, C, ...)\n- Themes\n- Text bolding (emphasis)\n- Written in pure Kotlin, so available for many platforms 📱 💻 🖥️\n\n## Support ☕\nKotlin Multiplatform is a fresh environment and developing for it is neither fast nor easy 🥲\n\nIf you feel that any of our project has saved you a time or effort, then consider supporting us via:  \n[🧋 Buy Me A Coffee](https://bmc.link/SnipMeDev)\n\n## Components 🧩\n\n### CodeTextView\nBasic component that takes instance of Highlights and applies coloring on a text.\n\n```kotlin\n@Composable\nfun MyApp() {\n    val highlights = remember {\n        mutableStateOf(\n            Highlights\n                .Builder(code = \"public static void main(String[] args) {}\")\n                .build()\n        )\n    }\n\n   MaterialTheme {\n      Column {\n        CodeTextView(highlights = highlights.value)\n      }\n   }\n}\n```\n\n### CodeEditText\nWith this component, you can update your code via `onValueChange` callback.  \nThe Highlights library is ready for incremental updates, so change values anytime.  \nThe view bases on `TextField()`, and all it's fields are available for customization.  \n\n```kotlin\n@Composable\nfun MyApp() {\n    val highlights = remember {\n        mutableStateOf(\n            Highlights\n                .Builder(code = \"public static void main(String[] args) {}\")\n                .build()\n        )\n    }\n\n   MaterialTheme {\n      Column {\n          CodeEditText(\n              highlights = highlights.value,\n              onValueChange = { textValue -\u003e\n                  highlights.value = highlights.value.getBuilder()\n                      .code(textValue)\n                      .build()\n              },\n              // Customize view's style\n              colors = TextFieldDefaults.textFieldColors(),\n          )\n      }\n   }\n}\n```\n\n## Run examples 🏎️\n\nNot all examples can be executed from command line, so recommended way is to use pre-created configurations:\n\n\u003cimg width=\"270\" alt=\"iShot_2023-09-18_08 19 44\" src=\"https://github.com/SnipMeDev/KodeView/assets/8405055/be660f49-5a77-445e-a717-6aaec9b5c28a\"\u003e\n\n## TODO 🚧\n- [X] CodeEditText\n\n## Contribution 💻\nAny form of support is very welcomed. \nBugs, problems and new feature requests should be placed in the `Issues` tab with proper labeling.\nNew feature can be also submitted via `Pull Requests`. \nThen make sure:\n- CHANGELOG and README have been updated\n- New code matches library's vision and code style\n\nLicense 🖋️\n=======\n\n    Copyright 2023 Tomasz Kądziołka.\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSnipMeDev%2FKodeView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSnipMeDev%2FKodeView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSnipMeDev%2FKodeView/lists"}