{"id":2020,"url":"https://github.com/SwiftStudies/SmarkDown","last_synced_at":"2025-08-02T05:33:32.170Z","repository":{"id":176097486,"uuid":"53961980","full_name":"SwiftStudies/SmarkDown","owner":"SwiftStudies","description":"A Pure Swift implementation of the markdown mark-up language","archived":false,"fork":false,"pushed_at":"2016-03-21T07:35:58.000Z","size":77,"stargazers_count":68,"open_issues_count":4,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-08-15T19:08:04.817Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SwiftStudies.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-03-15T16:48:16.000Z","updated_at":"2023-08-12T08:35:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"c86f4289-fe2a-4802-bb44-965d12ebdfb1","html_url":"https://github.com/SwiftStudies/SmarkDown","commit_stats":null,"previous_names":["swiftstudies/smarkdown"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftStudies%2FSmarkDown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftStudies%2FSmarkDown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftStudies%2FSmarkDown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftStudies%2FSmarkDown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SwiftStudies","download_url":"https://codeload.github.com/SwiftStudies/SmarkDown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228443869,"owners_count":17920804,"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.415Z","updated_at":"2024-12-06T09:30:51.186Z","avatar_url":"https://github.com/SwiftStudies.png","language":"Swift","funding_links":[],"categories":["UI","Text"],"sub_categories":["Layout","Other free courses","Other Testing","Keychain"],"readme":"[![Build Status](https://travis-ci.org/SwiftStudies/SmarkDown.svg?branch=master)](https://travis-ci.org/SwiftStudies/SmarkDown)\n\n# SmarkDown\n\nA pure Swift [markdown](http://daringfireball.net/projects/markdown/) implementation consistent with Gruber's 1.0.1  version. It is released under the BSD license so please feel free to use (at your own risk). \n\nPull requests are ***very*** welcome, see the vision for where I would like this to go. \n\n## Vision\n\nVersion 1.0 is a very minor Swift-ification of Gruber's original Perl implementation. Lots of regular expressions. The initial performance of this implementation yielded about 28s to process the large Markdown Syntax test. This has improved in 1.0.2 to 7s with some pretty simple optimization of what's there. \n\nHowever, I would next like to achieve two things\n\n 1. Refactor to support easier extension for particular variants of Markdown\n 2. Change the fundamental strategy from regular expressions to a higher performance scanner. In fact there are some seeds already sown there, but I want to clear out regular expressions. They are slow, opaque and the implementation has significant overhead. \n\nOnce again, I would ***love*** to receive pull requests towards this goal. \n\n## Building and Running with Swift Package Manager\n\n### Install Swift toolchain if you don't already have it\n\nIf you don't already have the latest Swift tool-chain it, it's not a huge download for the binary (\u003c200Mb), it **doesn't** impact or need anything specific from XCode (unless you want to integrate them), and it comes with an installer. You can [download it here](https://swift.org/download/).\n\nOnce you've done that all you will need to do is open a terminal window, make sure the latest tool-chain is in your path\n\n\texport PATH=/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:\"${PATH}\"\n\t\nChange to the SmarkDown package directory (where you can see this readme and the Sources, Tests, and Data directories for example).\n\n### Building and running\n\nThere are two modules in the package `SmarkDown` is the library you can use in your own projects, and the second is a command line tool `markdown` which takes a single parameter (which should be a .md markdown file) and outputs the resultant html. You can do a quick test with \n\n\tswift build\n\t.build/debug/markdown README.md\n\t\nYou should see the HTML version of the read me! As a side note, you have to love Swift Package Manager... it is so very easy to use and get going with!\n\n## Use in your code\n\nThere are two ways to use it, it provides an extension to String so you can simply do\n\n    let myString = \"# Cool\\n\\nThis markdown'd\\n\"\n    print(myString.markdown)\n\nor you can explicitly create an instance (which will have some minor performance improvements for repeated calls\n\n    let smarkDown = SmarkDown()\n    print(smarkDown.markdown(myString))\n\n## Integrating with your project\nSmarkDown uses the [Swift Package Manager](https://swift.org/package-manager/) so if you are using this for your builds you simply need to add a dependency to your manifest\n\n\timport PackageDescription\n\t\n\tlet package = Package(\n\t\tname : \"Your Project\",\n\t\tdependencies : [\n\t\t\t//Add the SmarkDown dependency\n\t\t\t.Package(url:\"https://github.com/SwiftStudies/SmarkDown.git\", majorVersion:1),\n\t\t]\n\t)\n\nAlternatively you can clone (or download) the repository to your computer and add the following files (if you are cloning then I would suggest adding without copying) to your project\n\n * `SmarkDown.swift`\n * `SpecialCharacters.swift`\n * `Strings.swift`\n * `RegularExpressions.swift`\n \nI'd recommend doing this in another target (such as library or framework) as there are some extensions you may not want to be exposed to (i.e. are internal to the module). \n\n## Reporting Issues\n\nPlease do so using Github's own system. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSwiftStudies%2FSmarkDown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSwiftStudies%2FSmarkDown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSwiftStudies%2FSmarkDown/lists"}