{"id":16061273,"url":"https://github.com/krzyzanowskim/sttextview-plugin-neon","last_synced_at":"2025-03-18T05:30:40.809Z","repository":{"id":189486261,"uuid":"680519590","full_name":"krzyzanowskim/STTextView-Plugin-Neon","owner":"krzyzanowskim","description":"Source Code Syntax Highlighting","archived":false,"fork":false,"pushed_at":"2024-02-12T00:13:58.000Z","size":36,"stargazers_count":18,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-14T04:55:38.065Z","etag":null,"topics":["plugin","sttextview","textview"],"latest_commit_sha":null,"homepage":"","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/krzyzanowskim.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}},"created_at":"2023-08-19T14:07:04.000Z","updated_at":"2024-08-06T03:20:11.058Z","dependencies_parsed_at":"2024-03-05T18:05:17.886Z","dependency_job_id":"3e8f4cac-1954-4b9c-ad82-038484e86b79","html_url":"https://github.com/krzyzanowskim/STTextView-Plugin-Neon","commit_stats":{"total_commits":31,"total_committers":5,"mean_commits":6.2,"dds":"0.16129032258064513","last_synced_commit":"51ee66d2c3e4c259b25af2f6e7c2671209f8d3a6"},"previous_names":["krzyzanowskim/sttextview-plugin-neon"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krzyzanowskim%2FSTTextView-Plugin-Neon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krzyzanowskim%2FSTTextView-Plugin-Neon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krzyzanowskim%2FSTTextView-Plugin-Neon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krzyzanowskim%2FSTTextView-Plugin-Neon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krzyzanowskim","download_url":"https://codeload.github.com/krzyzanowskim/STTextView-Plugin-Neon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243902293,"owners_count":20366260,"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":["plugin","sttextview","textview"],"created_at":"2024-10-09T04:08:25.855Z","updated_at":"2025-03-18T05:30:35.797Z","avatar_url":"https://github.com/krzyzanowskim.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"[STTextView](https://github.com/krzyzanowskim/STTextView) Source Code Syntax Highlighting with [TreeSitter](https://tree-sitter.github.io/tree-sitter/) and [Neon](https://github.com/ChimeHQ/Neon).\n\nhttps://github.com/user-attachments/assets/910b9862-c682-4dcc-ae0e-dbb55e8a3fe5\n\n## Installation\n\nAdd the plugin package as a dependency of your application, then register/add it to the STTextView instance:\n\n```swift\nimport NeonPlugin\n\ntextView.addPlugin(\n    NeonPlugin(\n        theme: .default,\n        language: .swift\n    )\n)\n```\n\nSwiftUI:\n```swift\nimport SwiftUI\nimport STTextViewUI\nimport NeonPlugin\n\nstruct ContentView: View {\n    @State private var text: AttributedString = \"\"\n    @State private var selection: NSRange?\n    var body: some View {\n        STTextViewUI.TextView(\n            text: $text,\n            selection: $selection,\n            options: [.wrapLines, .highlightSelectedLine],\n            plugins: [NeonPlugin(theme: .default, language: .swift)]\n        )\n        .textViewFont(.monospacedDigitSystemFont(ofSize: NSFont.systemFontSize, weight: .regular))\n        .onAppear {\n            loadContent()\n        }\n    }\n\n    private func loadContent() {\n        // (....)\n        self.text = AttributedString(string)\n    }\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrzyzanowskim%2Fsttextview-plugin-neon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrzyzanowskim%2Fsttextview-plugin-neon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrzyzanowskim%2Fsttextview-plugin-neon/lists"}