{"id":2057,"url":"https://github.com/EFPrefix/EFMarkdown","last_synced_at":"2025-08-02T23:31:20.727Z","repository":{"id":56909370,"uuid":"100601080","full_name":"EFPrefix/EFMarkdown","owner":"EFPrefix","description":"DEPRECATED","archived":true,"fork":false,"pushed_at":"2019-03-31T14:23:08.000Z","size":1708,"stargazers_count":380,"open_issues_count":2,"forks_count":25,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-12-05T13:42:45.522Z","etag":null,"topics":["ios","markdown","swift"],"latest_commit_sha":null,"homepage":"https://cocoapods.org/pods/EFMarkdown","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EFPrefix.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"2017-08-17T12:28:21.000Z","updated_at":"2024-12-02T04:00:09.000Z","dependencies_parsed_at":"2022-08-20T19:50:31.775Z","dependency_job_id":null,"html_url":"https://github.com/EFPrefix/EFMarkdown","commit_stats":null,"previous_names":["eyrefree/efmarkdown"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EFPrefix%2FEFMarkdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EFPrefix%2FEFMarkdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EFPrefix%2FEFMarkdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EFPrefix%2FEFMarkdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EFPrefix","download_url":"https://codeload.github.com/EFPrefix/EFMarkdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228503091,"owners_count":17930509,"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","markdown","swift"],"created_at":"2024-01-05T20:16:02.392Z","updated_at":"2024-12-06T17:30:31.572Z","avatar_url":"https://github.com/EFPrefix.png","language":"Swift","funding_links":[],"categories":["Text"],"sub_categories":["Other Testing","Keychain"],"readme":"![](https://raw.githubusercontent.com/EFPrefix/EFMarkdown/master/Assets/EFMarkdown.png)\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://travis-ci.org/EFPrefix/EFMarkdown\"\u003e\n        \u003cimg src=\"http://img.shields.io/travis/EFPrefix/EFMarkdown.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"http://cocoapods.org/pods/EFMarkdown\"\u003e\n        \u003cimg src=\"https://img.shields.io/cocoapods/v/EFMarkdown.svg?style=flat\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"http://cocoapods.org/pods/EFMarkdown\"\u003e\n        \u003cimg src=\"https://img.shields.io/cocoapods/p/EFMarkdown.svg?style=flat\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://raw.githubusercontent.com/EFPrefix/EFMarkdown/master/LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/cocoapods/l/EFMarkdown.svg?style=flat\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://twitter.com/EyreFree777\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/twitter-@EyreFree777-blue.svg?style=flat\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"http://weibo.com/eyrefree777\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/weibo-@EyreFree-red.svg?style=flat\"\u003e\n    \u003c/a\u003e\n    \u003cimg src=\"https://img.shields.io/badge/made%20with-%3C3-orange.svg\"\u003e\n\u003c/p\u003e\n\nEFMarkdown is a lightweight Markdown library in Swift, based on [EFCMark](https://github.com/EFPrefix/EFCMark), inspired by [markdown](https://github.com/vapor-community/markdown) and [Markoff](https://github.com/thoughtbot/Markoff).\n\n\u003e [中文介绍](https://github.com/EFPrefix/EFMarkdown/blob/master/README_CN.md)\n\n## Overview\n\nsample1|sample2|sample3|sample4  \n:---------------------:|:---------------------:|:---------------------:|:---------------------:\n![](https://raw.githubusercontent.com/EFPrefix/EFMarkdown/master/Assets/sample1.png)|![](https://raw.githubusercontent.com/EFPrefix/EFMarkdown/master/Assets/sample2.jpg)|![](https://raw.githubusercontent.com/EFPrefix/EFMarkdown/master/Assets/sample3.png)|![](https://raw.githubusercontent.com/EFPrefix/EFMarkdown/master/Assets/sample4.jpg)  \n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Requirements\n\n| Version | Needs                                                         |\n|:---------|:------------------------------------------------|\n| 0.x        | XCode 8.0+\u003cbr\u003eSwift 3.0+\u003cbr\u003eiOS 8.0+   |\n| 4.x        | XCode 9.0+\u003cbr\u003eSwift 4.0+\u003cbr\u003eiOS 8.0+   |\n| 5.x        | XCode 10.2+\u003cbr\u003eSwift 5.0+\u003cbr\u003eiOS 8.0+ |\n\n## Installation\n\nEFMarkdown is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"EFMarkdown\"\n```\n\n## Usage\n\n### 1. Markdown to HTML\n\nYou can use `EFMarkdown` to make Markdown string to HTML string easily:\n\n```swift\nlet markdown = \"# Hello\"\nvar html = \"\"\ndo {\n    html = try EFMarkdown().markdownToHTML(markdown, options: EFMarkdownOptions.safe)\n    print(html) // This will return \"\u003ch1\u003eHello\u003c/h1\u003e\\n\"\n} catch let error as NSError {\n    print (\"Error: \\(error.domain)\")\n}\n```\n\n### 2. View Markdown\n\nYou can use `EFMarkdownView` to make a preview of Markdown:\n\n```swift\nlet screenSize = UIScreen.main.bounds\nlet markView = EFMarkdownView()\nmarkView.frame = CGRect(x: 0, y: 20, width: screenSize.width, height: screenSize.height - 20)\nmarkView.onRendered = {\n    [weak self] (height) in\n    if let _ = self {\n        // Optional: you can know the change of height in this block\n        print(\"onRendered height: \\(height ?? 0)\")\n    }\n}\nself.view.addSubview(markView)\nmarkView.load(markdown: testMarkdownFileContent(), options: [.default]) {\n    [weak self] (_, _) in\n    if let _ = self {\n        // Optional: you can change font-size with a value of percent here\n        markView.setFontSize(percent: 128)\n        printLog(\"load finish!\")\n    }\n}\n```\n\n### 3. Options\n\nYou can pass different options to the underlying `cmark` library. By default `safe` is passed.\n\nThe available options are:\n\n* default\n* sourcePos\n* hardBreaks\n* safe\n* noBreaks\n* validateUTF8\n* smart\n* githubPreLang\n* liberalHtmlTag\n\nFor more information on the available options, see [`cmark`](https://github.com/github/cmark).\n\n## Author\n\nEyreFree, eyrefree@eyrefree.org\n\n## License\n\n\u003cimg src='http://www.wtfpl.net/wp-content/uploads/2012/12/logo-220x160.png' width='110' height='80'/\u003e\n\nEFMarkdown is available under the WTFPL license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEFPrefix%2FEFMarkdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEFPrefix%2FEFMarkdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEFPrefix%2FEFMarkdown/lists"}