{"id":13995429,"url":"https://github.com/hebertialmeida/MarkdownSyntax","last_synced_at":"2025-07-22T21:33:03.882Z","repository":{"id":139111010,"uuid":"215928893","full_name":"hebertialmeida/MarkdownSyntax","owner":"hebertialmeida","description":"☄️ A Type-safe Markdown parser in Swift. ","archived":false,"fork":false,"pushed_at":"2023-01-24T15:54:11.000Z","size":107,"stargazers_count":70,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-29T17:38:36.484Z","etag":null,"topics":["ast","cmark","markdown","markdown-parsing","mdast","swift","syntax-highlight","syntax-tree","unist"],"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/hebertialmeida.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}},"created_at":"2019-10-18T02:53:04.000Z","updated_at":"2024-08-08T13:29:18.000Z","dependencies_parsed_at":"2024-01-20T17:59:10.741Z","dependency_job_id":"fd9283ed-f775-401e-bb0a-678b2ca33bb1","html_url":"https://github.com/hebertialmeida/MarkdownSyntax","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/hebertialmeida/MarkdownSyntax","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hebertialmeida%2FMarkdownSyntax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hebertialmeida%2FMarkdownSyntax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hebertialmeida%2FMarkdownSyntax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hebertialmeida%2FMarkdownSyntax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hebertialmeida","download_url":"https://codeload.github.com/hebertialmeida/MarkdownSyntax/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hebertialmeida%2FMarkdownSyntax/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266578638,"owners_count":23951148,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ast","cmark","markdown","markdown-parsing","mdast","swift","syntax-highlight","syntax-tree","unist"],"created_at":"2024-08-09T14:03:24.300Z","updated_at":"2025-07-22T21:33:03.605Z","avatar_url":"https://github.com/hebertialmeida.png","language":"Swift","readme":"# ☄️ MarkdownSyntax\n\n![](https://github.com/hebertialmeida/MarkdownSyntax/workflows/Swift/badge.svg)\n[![codecov](https://codecov.io/gh/hebertialmeida/MarkdownSyntax/branch/master/graph/badge.svg)](https://codecov.io/gh/hebertialmeida/MarkdownSyntax)\n\nMarkdownSyntax is a wrapper on top of the Github Flavoured Markdown that conforms to [mdast](https://github.com/syntax-tree/mdast). It parses markdown and creates a normalized AST so you can use it not only for rendering markdown and syntax highlighting. In addition, you can render to standard cmark formats HTML, XML, Man, Latex, Plain Text.\n\n### Usage\n\n```swift\nlet input = \"Hi this is **alpha**\"\nlet tree = try Markdown(text: input).parse()\n```\n\nOutputs a normalized tree:\n\n```swift\nRoot(\n    children: [\n        Paragraph(\n            children: [\n                Text(\n                    value: \"Hi this is \", \n                    position: Position(\n                        start: Point(line: 1, column: 1, offset: 0), \n                        end: Point(line: 1, column: 11, offset: 10), \n                        indent: nil\n                    )\n                ), \n                Strong(\n                    children: [\n                        Text(\n                            value: \"alpha\", \n                            position: Position(\n                                start: Point(line: 1, column: 14, offset: 13), \n                                end: Point(line: 1, column: 18, offset: 17), \n                                indent: nil\n                            )\n                        )\n                    ], \n                    position: Position(\n                        start: Point(line: 1, column: 12, offset: 11), \n                        end: Point(line: 1, column: 20, offset: 19), \n                        indent: nil\n                    )\n                )\n            ], \n            position: Position(\n                start: Point(line: 1, column: 1, offset: 0), \n                end: Point(line: 1, column: 20, offset: 19), \n                indent: nil\n            )\n        )\n    ], \n    position: Position(\n        start: Point(line: 1, column: 1, offset: 0), \n        end: Point(line: 1, column: 20, offset: 19), \n        indent: nil\n    )\n)\n```\n\nFor more examples checkout the tests [MarkdownSyntaxTests](https://github.com/hebertialmeida/MarkdownSyntax/tree/master/Tests/MarkdownSyntaxTests).\n\n### Installation\n#### Swift Package Manager\n\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler.\n\nOnce you have your Swift package set up, adding MarkdownSyntax as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/hebertialmeida/MarkdownSyntax\", from: \"1.1.0\")\n]\n```\n\n### Acknowledgements\n\n- [cmark](https://github.com/commonmark/cmark)\n- [GitHub cmark fork](https://github.com/github/cmark)\n- [libcmark_gfm](https://github.com/KristopherGBaker/libcmark_gfm)\n","funding_links":[],"categories":["Swift"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhebertialmeida%2FMarkdownSyntax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhebertialmeida%2FMarkdownSyntax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhebertialmeida%2FMarkdownSyntax/lists"}