Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chore] Update readme #237

Merged
merged 1 commit into from
Dec 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 22 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
## Down
[![Build Status](https://travis-ci.org/iwasrobbed/Down.svg?branch=master)](https://travis-ci.org/iwasrobbed/Down)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](/~https://github.com/iwasrobbed/Down/blob/master/LICENSE)
[![Build Status](https://travis-ci.com/johnxnguyen/Down.svg?branch=master)](https://travis-ci.com/johnxnguyen/Down)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](/~https://github.com/johnxnguyen/Down/blob/master/LICENSE)
[![CocoaPods](https://img.shields.io/cocoapods/v/Down.svg?maxAge=10800)]()
[![Swift 5](https://img.shields.io/badge/language-Swift-blue.svg)](https://swift.org)
[![macOS](https://img.shields.io/badge/OS-macOS-orange.svg)](https://developer.apple.com/macos/)
[![iOS](https://img.shields.io/badge/OS-iOS-orange.svg)](https://developer.apple.com/ios/)
[![tvOS](https://img.shields.io/badge/OS-tvOS-orange.svg)](https://developer.apple.com/tvos/)
[![Linux](https://img.shields.io/badge/OS-Linux-orange.svg)](https://www.linux.org/)
[![Code Coverage](https://codecov.io/gh/iwasrobbed/Down/branch/master/graph/badge.svg)](https://codecov.io/gh/iwasrobbed/Down)
[![Code Coverage](https://codecov.io/gh/johnxnguyen/Down/branch/master/graph/badge.svg)](https://codecov.io/gh/johnxnguyen/Down)

Blazing fast Markdown (CommonMark) rendering in Swift, built upon [cmark v0.29.0](/~https://github.com/commonmark/cmark).

Is your app using it? [Let us know!](mailto:rob@robphillips.me)
Is your app using it? [Let us know!](mailto:polyxo@protonmail.com)

If you're looking for `iwasrobbed/Down`, you found it! [Rob Phillips](/~https://github.com/iwasrobbed), the originator of this repository,
has transferred it to me as I will be the primary maintainer from now on. Thanks to Rob for bringing Down as far as it has come and for
entrusting me with its care.

All existing references to `iwasrobbed/Down` should redirect to this repository. However, It is recommended to update those urls to point
to this repository.

#### Maintainers

- [Rob Phillips](/~https://github.com/iwasrobbed)
- [John Nguyen](/~https://github.com/johnxnguyen)
- [Rob Phillips](/~https://github.com/iwasrobbed)
- [Keaton Burleson](/~https://github.com/128keaton)
- [phoney](/~https://github.com/phoney)
- [Tony Arnold](/~https://github.com/tonyarnold)
- [Ken Harris](/~https://github.com/kengruven)
- [Chris Zielinski](/~https://github.com/chriszielinski)
- [Other contributors](/~https://github.com/iwasrobbed/Down/graphs/contributors) 🙌
- [Other contributors](/~https://github.com/johnxnguyen/Down/graphs/contributors) 🙌

### Installation

Expand All @@ -46,7 +53,7 @@ pod 'Down'
#### Install using [Carthage](/~https://github.com/Carthage/Carthage):

```
github "iwasrobbed/Down"
github "johnxnguyen/Down"
```
Due to limitations in Carthage regarding platform specification, you need to define the platform with Carthage.

Expand Down Expand Up @@ -107,27 +114,27 @@ Meta example of rendering this README:
The `Down` struct has everything you need if you just want out-of-the-box setup for parsing and conversion.

```swift
let down = Down(markdownString: "## [Down](/~https://github.com/iwasrobbed/Down)")
let down = Down(markdownString: "## [Down](/~https://github.com/johnxnguyen/Down)")

// Convert to HTML
let html = try? down.toHTML()
// "<h2><a href=\"/~https://github.com/iwasrobbed/Down\">Down</a></h2>\n"
// "<h2><a href=\"/~https://github.com/johnxnguyen/Down\">Down</a></h2>\n"

// Convert to XML
let xml = try? down.toXML()
// "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE document SYSTEM \"CommonMark.dtd\">\n<document xmlns=\"http://commonmark.org/xml/1.0\">\n <heading level=\"2\">\n <link destination=\"/~https://github.com/iwasrobbed/Down\" title=\"\">\n <text>Down</text>\n </link>\n </heading>\n</document>\n"
// "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE document SYSTEM \"CommonMark.dtd\">\n<document xmlns=\"http://commonmark.org/xml/1.0\">\n <heading level=\"2\">\n <link destination=\"/~https://github.com/johnxnguyen/Down\" title=\"\">\n <text>Down</text>\n </link>\n </heading>\n</document>\n"

// Convert to groff man
let man = try? down.toGroff()
// ".SS\nDown (/~https://github.com/iwasrobbed/Down)\n"
// ".SS\nDown (/~https://github.com/johnxnguyen/Down)\n"

// Convert to LaTeX
let latex = try? down.toLaTeX()
// "\\subsection{\\href{/~https://github.com/iwasrobbed/Down}{Down}}\n"
// "\\subsection{\\href{/~https://github.com/johnxnguyen/Down}{Down}}\n"

// Convert to CommonMark Markdown
let commonMark = try? down.toCommonMark()
// "## [Down](/~https://github.com/iwasrobbed/Down)\n"
// "## [Down](/~https://github.com/johnxnguyen/Down)\n"

// Convert to an attributed string
let attributedString = try? down.toAttributedString()
Expand Down Expand Up @@ -181,11 +188,11 @@ public struct MarkdownToHTML: DownHTMLRenderable {
`DownView` can be configured with a custom bundle using your own HTML / CSS or to do things like supporting
Dynamic Type or custom fonts, etc. It's completely configurable.

This option can be found in [DownView's instantiation function](/~https://github.com/iwasrobbed/Down/blob/master/Source/Views/DownView.swift#L26).
This option can be found in [DownView's instantiation function](/~https://github.com/johnxnguyen/Down/blob/master/Source/Views/DownView.swift#L26).

##### Prevent zoom

The default implementation of the `DownView` allows for zooming in the rendered content. If you want to disable this, then you’ll need to instantiate the `DownView` with a custom bundle where the `viewport` in `index.html` has been assigned `user-scalable=no`. More info can be found [here](/~https://github.com/iwasrobbed/Down/pull/30).
The default implementation of the `DownView` allows for zooming in the rendered content. If you want to disable this, then you’ll need to instantiate the `DownView` with a custom bundle where the `viewport` in `index.html` has been assigned `user-scalable=no`. More info can be found [here](/~https://github.com/johnxnguyen/Down/pull/30).

### Options

Expand Down