<commit_before># Bypass

Bypass is a markdown rendering library that can directly render markdown as
stylized text to a `UIView`. The Bypass git repository also contains an Android
project that accomplish the same task. In the git repo, there is also code that
handles markdown parsing and representing that markdown as a tree structure,
similar to the HTML DOM. This code is shared between both platforms.

Bypass is very easy to use. Ultimately, you will end up creating a
`BPMarkdownView`, supplying that view with markdown as an `NSString`, and then
displaying it like you would any other view in your heirarchy. `BPMarkdownView`
descends from `UIScrollView`, so you can supply large bodies of markdown.

It features nicely stylized text for typical usage, tappable links, and a smooth
crossfade between representations for different device orientations.

## Requirements

Bypass requires iOS version 6.0 or greater.

## Setup

TODO

## Usage

Bypass is very easy to use in terms of displaying markdown. Essentially, you
directly instantiate a `BPMarkdownView` and supply it with markdown to render.
It handles the rest. An example would be:

```objc
// Initialize the markdown view
CGRect markdownRect = CGRectMake(0.f, 0.f, 100.f, 100.f);
BPMarkdownView *markdownView = [[BPMarkdownView alloc] initWithFrame:markdownRect];

// Obtain some markdown
NSString *markdown = @""
    "# Hello, world!"
    ""
    "This is my text body. There are many like it, "
    "but this one is mine.";

// Supply the markdown view with markdown to render
[markdownView setMarkdown:markdown];

// Add the markdown view to a superview
[[self view] addSubview:markdownView];
```

Feel free to directly embed a `BPMarkdownView` in a Nib or Storyboard, but
ensure that you have configured your **Other Linker Flags** to contain `-ObjC`
if you do this.<commit_msg>Adding usage instructions to the readme<commit_after># Bypass

Bypass is a markdown library that can directly render markdown as stylized text
in a `UIView`. It features nicely styled text, tappable links, and a smooth
crossfade between representations for different device orientations.

There is also an [Android version](https://github.com/Uncodin/bypass-android)
of this library, that shares the [same core](http://gitub.com/Uncodin/bypass-core).

## Requirements

Bypass requires iOS version 6.0 or greater.

## Usage

Choose from either CocoaPods inclusion or git submodule inclusion for integrating
Bypass into your project.

### CocoaPods

Assuming you have CocoaPods installed, you can start using Bypass by doing the following:

* Create your Xcode project
* Add a `Podfile` that references `Bypass` alongside your Xcode project with the following content:

```ruby
platform :ios, '6.0'
pod 'Bypass', '~> 1.0.1'
```

* Issue `pod install` on the command line from the root project directory
* Start development by using the generated workspace in Xcode

#### References

* [CocoaPods: Integrating a Project](http://docs.cocoapods.org/guides/integrating_a_project.html)
* [CocoaPods: Podfile](http://docs.cocoapods.org/podfile.html)

### Git Submodules

* Create your Xcode project and [initialize your git repository](http://gitref.org/creating/).
* Assuming you have a directory named `Libraries`, issue the command `git submodule add <EMAIL>@github.<EMAIL>:Uncodin/bypass-ios.git Libraries/Bypass`
* Issue the command `git submodule update --init --recursive`
* Open your Xcode project and drag the `Libraries/Bypass/Bypass.xcodeproj` into your project by dropping it into the Project Navigator
* Navigate to your project's Build Settings
  * Add `-ObjC` to `Other Linker Flags`
* Navigate to your project's Build Phases
  * Add `Bypass` as a target dependency
  * Lower down in the same tab, add `QuartzCore.framework`, `CoreText.framework`, and `libBypass.a` to the list of libraries to link againts.

## Usage

Bypass is very easy to use. An example usage follows:

```objc
CGRect markdownRect = CGRectMake(0.f, 0.f, 100.f, 100.f);
BPMarkdownView *markdownView = [[BPMarkdownView alloc] initWithFrame:markdownRect];

NSString *markdown = @"# Hello, world!"
                      ""
                      "This is my text body. There are many like it,	 "
                      "but this one is mine.";

[markdownView setMarkdown:markdown];
[[self view] addSubview:markdownView];
```

Feel free to directly embed a `BPMarkdownView` in a Nib or Storyboard, but
ensure that you have configured your **Other Linker Flags** to contain `-ObjC`
if you do this.
{'fraction_non_alphanumeric': 0.08132062929315312, 'fraction_numerical': 0.005539552404165743, 'mean_word_length': 4.3610451306413305, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4056557', 'n_tokens_mistral': 1368, 'n_tokens_neox': 1286, 'n_words': 578}