GithubHelp home page GithubHelp logo

swiftydown's Introduction

SwiftyDown

SwiftyDown - Simple, Elegant, Powerful markdown parser written in swift.

If you have any thoughts or needs about this project, file an issue immediately :)

Why SwiftyDown

Compare to SwiftyMarkdown, SwiftyDown provides:

  • Nested mark support, like Bold link,
  • Enhanced markdown features like multi-line code block,reference paragraph and deleted lines
  • Parser-combinator based parsing process, always extensible within just few elegant code.
  • Configurable attributed option.
  • High performance rendering.

Install

  • Use Cocoapods:
pod 'SwiftyDown'
  • or just drag Parser.swift, MarkdownParser.swift and Syntax.swift to your project folder.

Support format

# Heading1
## Heading2
### Heading3
#### Heading4
##### Heading5
###### Heading6
####### Heading7
...

**Bold**

*italics*

`inline code block`

[Hyperlink](github.com)

and nested syntax like:

`**nested**`
*[italics links](yahoo.com)*

```Code Block`` 

> reference paragraph

~~deleted lines~~

 

Usage

import SwiftyDown

let str = "# Header1 \n plain text \n \n##Header2 \n\n ###Header3\n \n ####Header4 \n \n#####Header5  \n\n######Header6 \n\n\n\n\n \n#######Header7 > Test \n\n> Test2 \n > Test3, okay, this is a quote format test. Sure it can be `**nested**`, like [that](yahoo.com) \n\n ########Header8  \n\n#########Header9  \n\n\n\n##########Header10 \n\n \n  Regular text. `inline code block` and some **bold**, *[italics links](yahoo.com)* \n \n  this is a [hyperlinks](http://www.yahoo.com)"
        
let m = MarkdownParser()

label.attributedText = m.convert(str)

Screenshots

Large text display

swiftydown's People

Contributors

aaaron7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

swiftydown's Issues

list format does not achieve

In Markdown, adding - or * can unordered list, but in this library, I found there is no way to achieve it .

And there is some problem, the library does not convert html tag to markdown format, for example, this is a strong text , then will print all the words rather than "this is a strong text " with strong format

Cannot show the markdown format

I import the library correctly, then I use it in simple case, but not show markdown format, there is some code:` override func viewDidLoad() {
super.viewDidLoad()

    let label2 = UILabel(frame:CGRectMake(10,20, 300, 100))
    let str = "# Header1 \n plain text \n \n##Header2 \n\n ###Header3\n \n ####Header4 \n \n#####Header5  \n\n######Header6 \n\n\n\n\n \n#######Header7 > Test \n\n> Test2 \n > Test3, okay, this is a quote format test. Sure it can be `**nested**`, like [that](yahoo.com) \n\n ########Header8  \n\n#########Header9  \n\n\n\n##########Header10 \n\n \n  Regular text. `inline code block` and some **bold**, *[italics links](yahoo.com)* \n \n  this is a [hyperlinks](http://www.yahoo.com)"

    let m = MarkdownParser()

    label2.textAlignment=NSTextAlignment.Left //文字右对齐
    label2.textColor=UIColor.whiteColor()  //白色文字
    label2.backgroundColor=UIColor.blackColor() //黑色背景
    label2.attributedText = m.convert(str)
}

` Hope your help!

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.