Git Product home page Git Product logo

mmmarkdown's Introduction

MMMarkdown

MMMarkdown is an Objective-C framework for converting Markdown to HTML. It is compatible with OS X 10.6+, iOS 8.0+, tvOS, and watchOS.

Unlike other Markdown libraries, MMMarkdown implements an actual parser. It is not a port of the original Perl implementation and does not use regular expressions to transform the input into HTML. MMMarkdown tries to be efficient and minimize memory usage.

API

Using MMMarkdown is simple. The main API is a single class method:

#import <MMMarkdown/MMMarkdown.h>

NSError  *error;
NSString *markdown   = @"# Example\nWhat a library!";
NSString *htmlString = [MMMarkdown HTMLStringWithMarkdown:markdown error:&error];
// Returns @"<h1>Example</h1>\n<p>What a library!</p>"

The markdown string that is passed in must be non-nil.

MMMarkdown also supports a number of Markdown extensions:

#import <MMMarkdown/MMMarkdown.h>

NSString *markdown   = @"~~Mistaken~~";
NSString *htmlString = [MMMarkdown HTMLStringWithMarkdown:markdown extensions:MMMarkdownExtensionsGitHubFlavored error:NULL];
// Returns @"<p><del>Mistaken</del></p>"

Setup

Adding MMMarkdown to your project is easy.

If you’d like to use Carthage, add the following line to your Cartfile:

github "mdiep/MMMarkdown"

Otherwise, you can:

  1. Add MMMarkdown as a git submodule. (git submodule add https://github.com/mdiep/MMMarkdown <path>)

  2. Add MMMarkdown.xcodeproj to your project or workspace

  3. Add MMMarkdown.framework to the ”Link Binary with Libraries" section of your project's “Build Phases”.

  4. Add MMMarkdown.framework to a ”Copy Files” build phase that copies it to the Frameworks destination.

License

MMMarkdown is available under the MIT License.

mmmarkdown's People

Contributors

mdiep avatar tewha avatar shiweifu avatar neonichu avatar keefo avatar glenyi avatar gvalmon avatar soleares avatar jyhong836 avatar shaharhd avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.