{"id":27264220,"url":"https://github.com/dasautoooo/parma","last_synced_at":"2025-10-03T22:02:20.664Z","repository":{"id":41405657,"uuid":"287770076","full_name":"dasautoooo/Parma","owner":"dasautoooo","description":"A SwiftUI view for displaying Markdown with customizable appearances.","archived":false,"fork":false,"pushed_at":"2021-12-24T11:15:11.000Z","size":240,"stargazers_count":799,"open_issues_count":16,"forks_count":46,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-04-09T19:31:26.941Z","etag":null,"topics":["ios","macos","markdown","swift","swiftui"],"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/dasautoooo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-15T15:10:14.000Z","updated_at":"2025-03-28T09:16:07.000Z","dependencies_parsed_at":"2022-08-10T02:07:26.062Z","dependency_job_id":null,"html_url":"https://github.com/dasautoooo/Parma","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasautoooo%2FParma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasautoooo%2FParma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasautoooo%2FParma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasautoooo%2FParma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dasautoooo","download_url":"https://codeload.github.com/dasautoooo/Parma/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248358548,"owners_count":21090401,"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","markdown","swift","swiftui"],"created_at":"2025-04-11T06:51:52.609Z","updated_at":"2025-10-03T22:02:15.624Z","avatar_url":"https://github.com/dasautoooo.png","language":"Swift","readme":"# Parma\nDisplay Markdown using pure SwiftUI components. Taking advantages of `ViewBuilder` to make custom appearances for `Text` and `View`.\n\n## Example\n```swift\nimport Parma\n\nstruct ContentView: View {\n    var markdown = \"I'm **Strong**.\"\n    \n    var body: some View {\n        Parma(markdown)\n    }\n}\n```\nFor more examples, please refer to [demo][1] app.\n\n## Markdown Support\n### Already Supported\n* Heading level 1-6\n* Paragraph\n* Multi-level bullet list\n* Multi-level ordered list\n    * Period delimiter\n    * Parenthesis delimiter\n* Image (Needs extra configurations)\n* Inline text\n    * Strong\n    * Emphasis\n    * Code\n\n### Possibly Support in Future Versions\n* Divider\n* Block quote\n* Code block\n\n### Unsupported\n* Inline hyperlink\n\n## Installation\n### Requirement\n* Xcode 11.0 or later\n* Swift 5 or later\n* iOS 13.0 / macOS 10.15 or later deployment targets\n\n### Swift Package Manager\n[Swift Package Manager][2] is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies on all platforms.\n\nAdding `Parma` as a dependency by [using Xcode’s GUI][3], the package url is `https://github.com/dasautoooo/Parma` .\n\n### CocoaPods\n[CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate `Parma` into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\npod 'Parma'\n```\n\n\n## Appearance Customization\nTo customize `Text` styles and `View`s, create a new render which conform to protocol `ParmaRenderable`, and only reimplement those that fit your purposes. Finally, assign the customized render as a new render when create `Parma` view.\n\n```swift\nimport Parma\n\nstruct ContentView: View {\n    var markdown = \"I'm **Strong**.\"\n    \n    var body: some View {\n        Parma(markdown, render: MyRender())\n    }\n}\n\nstruct MyRender: ParmaRenderable {\n    ...\n}\n```\n\nThere's a [DemoApp][4] that modified some of these delegate methods below for everyone to take as a reference.\n\n```swift\n/// Define the heading text style.\n/// - Parameters:\n///   - level: The level of heading.\n///   - textView: The textView generated from captured heading string.\nfunc heading(level: HeadingLevel?, textView: Text) -\u003e Text\n\n/// Define the paragraph text style.\n/// - Parameter text: The text string captured from paragraph.\nfunc paragraph(text: String) -\u003e Text\n\n/// Define the text style for plain text. Do NOT recommend to alter this if there's no special purpose.\n/// - Parameter text: The text string captured from markdown.\nfunc plainText(_ text: String) -\u003e Text\n\n/// Define the strong text style.\n/// - Parameter textView: The textView generated from captured strong string.\nfunc strong(textView: Text) -\u003e Text\n\n/// Define the emphasis text style.\n/// - Parameter textView: The textView generated from captured emphasis string.\nfunc emphasis(textView: Text) -\u003e Text\n\n/// Define the link text style.\n/// - Parameters:\n///   - textView: The textView generated from captured link string.\n///   - destination: The destination of the link.\nfunc link(textView: Text, destination: String?) -\u003e Text\n\n/// Define the code text style.\n/// - Parameter text: The text string captured from code.\nfunc code(_ text: String) -\u003e Text\n\n/// Define the style of heading view.\n/// - Parameters:\n///   - level: The level of heading.\n///   - view: The view contains heading text.\nfunc headingBlock(level: HeadingLevel?, view: AnyView) -\u003e AnyView\n\n/// Define the style of paragraph view.\n/// - Parameter view: The view contains view(s) which belong(s) to this paragraph.\nfunc paragraphBlock(view: AnyView) -\u003e AnyView\n\n/// Define the style of list item.\n/// - Parameter attributes: Attributes of the list containing the item. Those must be considered for proper item rendering.\n/// - Parameter index: Normalized index of the list item. For exemple, the index of the third item of a one level list would be `[2]` and the second item of a sublist appearing fourth in it's parent list would be `[3, 1]`.\n/// - Parameter view: The view contains view(s) which belong(s) to this item.\nfunc listItem(attributes: ListAttributes, index: [Int], view: AnyView) -\u003e AnyView\n\n/// Define the style of image view.\n/// - Parameter urlString: The url string for this image view.\n/// - Parameter altTextView: The view contains alt text.\nfunc imageView(with urlString: String, altTextView: AnyView?) -\u003e AnyView\n```\n\n## Name Origin\n[Parma][5] is a city in the northern Italy, which is famous for its architecture, music and art. The reason of choosing this city name as the project name is [Giambattista Bodoni][6], a famous typographer, who spent most his lifetime living and working in this city.\n\nBodoni was an Italian typographer, type-designer in Parma. During his lifespan, he designed many typefaces that known as [Bodoni][7] nowadays. Each Mac has Bodoni font installed, and free to use.\n\n## Credit\nThe package is built upon [Down][8], which is a markdown parser in Swift.\n\n[1]:\thttps://github.com/dasautoooo/ParmaDemo\n[2]:\thttps://swift.org/package-manager/\n[3]:\thttps://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app\n[4]:\thttps://github.com/dasautoooo/ParmaDemo\n[5]:\thttps://en.wikipedia.org/wiki/Parma\n[6]:\thttps://en.wikipedia.org/wiki/Giambattista_Bodoni\n[7]:\thttps://en.wikipedia.org/wiki/Bodoni\n[8]:\thttps://github.com/iwasrobbed/Down\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdasautoooo%2Fparma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdasautoooo%2Fparma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdasautoooo%2Fparma/lists"}