{"id":17648781,"url":"https://github.com/maoyama/syntaxhighlight","last_synced_at":"2025-05-07T03:25:16.084Z","repository":{"id":79141031,"uuid":"296984462","full_name":"maoyama/SyntaxHighlight","owner":"maoyama","description":"TextMate-style syntax highlighting for SwiftUI","archived":false,"fork":false,"pushed_at":"2025-04-10T08:07:28.000Z","size":393,"stargazers_count":40,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-19T17:58:11.025Z","etag":null,"topics":["ios","macos","swiftui","syntax-highlighting"],"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/maoyama.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}},"created_at":"2020-09-20T02:03:04.000Z","updated_at":"2024-10-16T12:22:37.000Z","dependencies_parsed_at":"2025-04-19T14:43:29.765Z","dependency_job_id":"5a2de0cb-b777-4261-ac93-1558c2fcd9de","html_url":"https://github.com/maoyama/SyntaxHighlight","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maoyama%2FSyntaxHighlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maoyama%2FSyntaxHighlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maoyama%2FSyntaxHighlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maoyama%2FSyntaxHighlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maoyama","download_url":"https://codeload.github.com/maoyama/SyntaxHighlight/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252805385,"owners_count":21806989,"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":["ios","macos","swiftui","syntax-highlighting"],"created_at":"2024-10-23T11:20:35.559Z","updated_at":"2025-05-07T03:25:16.061Z","avatar_url":"https://github.com/maoyama.png","language":"Swift","readme":"# SyntaxHighlight\n\nSyntaxHighlight makes TextMate-style syntax highlighting easy for SwiftUI.\n\n\u003cimg src=\"./ScreenShots/js.png\" width=\"380\"\u003e\u003cimg src=\"./ScreenShots/swift.png\" width=\"380\"\u003e\n\n\n## Usage\n\nSyntaxHighlight uses `.tmTheme` and `.tmLanguage.json` files to highlight source code. None are provided with SyntaxHighlight. Thankfully, there are tons available at [Visual Studio Code Extensions](https://github.com/microsoft/vscode/tree/master/extensions) and [TextMate's GitHub org](https://github.com/textmate).\n\n```swift\nimport SwiftUI\nimport SyntaxHighlight\n\nstruct ContentView: View {\n    var theme = try! Theme(contentsOf: Bundle.main.url(forResource: \"Tomorrow\", withExtension: \"tmTheme\")!)\n    var grammar = try! Grammar(contentsOf: Bundle.main.url(forResource: \"JavaScript.tmLanguage\", withExtension: \"json\")!)\n    \n    var body: some View {\n        Text(from: Highlighter(string: \"// JavaScript\", theme: theme, grammar: grammar))\n    }\n}\n```\n\n## Installation\n\nSyntaxHighlight is available through [Swift Package Manager](https://github.com/apple/swift-package-manager/).\n\n```swift\nlet package = Package(\n    ...\n    dependencies: [\n        .package(url: \"https://github.com/maoyama/SyntaxHighlight.git\", from: \"0.1.0\")\n    ],\n    ...\n)\n```\n\n## Requirements\n- iOS13+\n- macOS Catalina\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaoyama%2Fsyntaxhighlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaoyama%2Fsyntaxhighlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaoyama%2Fsyntaxhighlight/lists"}