{"id":2034,"url":"https://github.com/bmoliveira/MarkdownKit","last_synced_at":"2025-08-06T14:32:57.352Z","repository":{"id":9898308,"uuid":"63709739","full_name":"bmoliveira/MarkdownKit","owner":"bmoliveira","description":"A simple and customizable Markdown Parser for Swift","archived":false,"fork":false,"pushed_at":"2024-07-31T07:39:32.000Z","size":595,"stargazers_count":795,"open_issues_count":26,"forks_count":142,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-12-05T13:02:53.613Z","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/bmoliveira.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}},"created_at":"2016-07-19T16:17:25.000Z","updated_at":"2024-12-05T01:28:41.000Z","dependencies_parsed_at":"2024-12-05T13:02:27.849Z","dependency_job_id":"6609b16e-3155-4587-834f-b1e175bc53f4","html_url":"https://github.com/bmoliveira/MarkdownKit","commit_stats":{"total_commits":181,"total_committers":28,"mean_commits":6.464285714285714,"dds":0.6629834254143646,"last_synced_commit":"4270b02490752f5c224de790764465faf552ec63"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmoliveira%2FMarkdownKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmoliveira%2FMarkdownKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmoliveira%2FMarkdownKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmoliveira%2FMarkdownKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bmoliveira","download_url":"https://codeload.github.com/bmoliveira/MarkdownKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228915450,"owners_count":17991406,"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":[],"created_at":"2024-01-05T20:16:01.758Z","updated_at":"2025-08-06T14:32:57.308Z","avatar_url":"https://github.com/bmoliveira.png","language":"Swift","funding_links":[],"categories":["Libs","Text","HarmonyOS","Text [🔝](#readme)"],"sub_categories":["Text","Other free courses","Windows Manager","Other Testing","Keychain"],"readme":"![Logo](https://raw.githubusercontent.com/ivanbruel/MarkdownKit/master/Resources/MarkdownKitLogo.png)\n\nMarkdownKit\n=========\n\n[![Version](https://img.shields.io/cocoapods/v/MarkdownKit.svg?style=flat)](http://cocoapods.org/pods/MarkdownKit)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![License](https://img.shields.io/cocoapods/l/MarkdownKit.svg?style=flat)](http://cocoapods.org/pods/MarkdownKit)\n[![Platform](https://img.shields.io/cocoapods/p/MarkdownKit.svg?style=flat)](http://cocoapods.org/pods/MarkdownKit)\n[![CI](https://github.com/bmoliveira/MarkdownKit/actions/workflows/CI.yml/badge.svg)](https://github.com/bmoliveira/MarkdownKit/actions/workflows/CI.yml)\n\nMarkdownKit is a customizable and extensible Markdown parser for iOS and macOS. It supports many of the standard Markdown elements through the use of Regular Expressions. It also allows customization of font and color attributes for all the Markdown elements.\n\n## Screenshot\n\n![Example](https://raw.githubusercontent.com/ivanbruel/MarkdownKit/master/Resources/MarkdownKitExample.png)\n\n## Installation\n\n### Installation via CocoaPods\n\nMarkdownKit is available through [CocoaPods](http://cocoapods.org). CocoaPods is a dependency manager that automates and simplifies the process of using 3rd-party libraries like MarkdownKit in your projects. You can install CocoaPods with the following command:\n\n```ruby\ngem install cocoapods\n```\n\nTo integrate MarkdownKit into your Xcode project using CocoaPods, simply add the following line to your Podfile:\n\n```ruby\npod \"MarkdownKit\"\n```\n\nAfterwards, run the following command:\n\n```ruby\npod install\n```\n\n### Installation via Carthage\n\nMarkdownKit is available through [Carthage](https://github.com/Carthage/Carthage). Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage via [Homebrew](http://brew.sh) with the following command:\n\n```ruby\nbrew update\nbrew install carthage\n```\n\nTo integrate MarkdownKit into your Xcode project using Carthage, simply add the following line to your Cartfile:\n\n```ruby\ngithub \"ivanbruel/MarkdownKit\"\n```\n\nAfterwards, run the following command:\n\n```ruby\ncarthage update --use-xcframeworks\n```\n\n### Installation via Swift Package Manager\n\nMarkdownKit is available through [Swift Package Manager](https://swift.org/package-manager/).\n\nTo add MarkdownKit as a dependency of your Swift package, simply add the following line to your `Package.swift` file:\n\n```swift\n.package(url: \"https://github.com/bmoliveira/MarkdownKit.git\", from: \"1.7.2\")\n```\n\n## Supported Elements\n\n```\n*italic* or _italics_\n**bold** or __bold__\n~~strikethrough~~\n\n# Header 1\n## Header 2\n### Header 3\n#### Header 4\n##### Header 5\n###### Header 6\n\n\u003e Quote\n\n* List\n- List\n+ List\n\n`code` or ```code```\n[Links](http://github.com/ivanbruel/MarkdownKit/)\n```\n\n## Usage\n\nIn order to use MarkdownKit to transform Markdown into NSAttributedString, all you have to do is create an instance of `MarkdownParser` and call the `parse(_)` function.\n\n```swift\nlet markdownParser = MarkdownParser()\nlet markdown = \"I support a *lot* of custom Markdown **Elements**, even `code`!\"\nlabel.attributedText = markdownParser.parse(markdown)\n```\n\n## Customization\n\n```swift\nlet markdownParser = MarkdownParser(font: UIFont.systemFont(ofSize: 18))\nmarkdownParser.enabledElements = .disabledAutomaticLink\nmarkdownParser.bold.color = UIColor.red\nmarkdownParser.italic.font = UIFont.italicSystemFont(ofSize: 300)\nmarkdownParser.header.fontIncrease = 4\n```\n\n## Extensibility\n\nTo add new Markdown elements all you have to do is implement the `MarkdownElement` protocol (or descendants) and add it to the `MarkdownParser`.\n\n```swift\nimport MarkdownKit\n\nclass MarkdownSubreddit: MarkdownLink {\n\n  private static let regex = \"(^|\\\\s|\\\\W)(/?r/(\\\\w+)/?)\"\n\n  override var regex: String {\n    return MarkdownSubreddit.regex\n  }\n\n  override func match(match: NSTextCheckingResult,\n                             attributedString: NSMutableAttributedString) {\n    let subredditName = attributedString.attributedSubstringFromRange(match.rangeAtIndex(3)).string\n    let linkURLString = \"http://reddit.com/r/\\(subredditName)\"\n    formatText(attributedString, range: match.range, link: linkURLString)\n    addAttributes(attributedString, range: match.range, link: linkURLString)\n  }\n\n}\n```\n\n```swift\nlet markdownParser = MarkdownParser(customElements: [MarkdownSubreddit()])\nlet markdown = \"**/r/iosprogramming** can be *markdown* as well!\"\nlabel.attributedText = markdownParser.parse(markdown)\n```\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Acknowledgements\n\nThis library is heavily inspired in [TSMarkdownParser](https://github.com/laptobbe/TSMarkdownParser) and also [SwiftyMarkdown](https://github.com/SimonFairbairn/SwiftyMarkdown).\n\nSpecial thanks to [Michael Brown](https://github.com/mluisbrown) for helping out with the [UTF-16 Escaping/Unescaping](https://github.com/bmoliveira/MarkdownKit/blob/master/MarkdownKit/Sources/Common/Extensions/String%2BUTF16.swift).\n\n## License\n\nMarkdownKit is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmoliveira%2FMarkdownKit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbmoliveira%2FMarkdownKit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmoliveira%2FMarkdownKit/lists"}