All Projects → chojnac → Dumpling

chojnac / Dumpling

Licence: MIT license
Customisable and extensible Markdown parser written in Swift

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Dumpling

BVSelect-VanillaJS
BVSelect - Vanilla Javascript Fully Customizable SelectBox
Stars: ✭ 107 (+197.22%)
Mutual labels:  customizable
Customizable-Crypto-Currency-Dashboard-with-Chart
📺 A Dashboard with the price movements of the selected Cryptocurrencies 💹
Stars: ✭ 79 (+119.44%)
Mutual labels:  customizable
whatisnewdialog
An Android library for displaying a dialog where it presents new features in the app.
Stars: ✭ 22 (-38.89%)
Mutual labels:  customizable
PermissionManager
This Library automatically search for permission in androidmanifests file and request for the same
Stars: ✭ 45 (+25%)
Mutual labels:  customizable
linkin
Linkin is a customizable self hosted link tree platform.
Stars: ✭ 62 (+72.22%)
Mutual labels:  customizable
NBT
A java implementation of the NBT protocol, including a way to implement custom tags.
Stars: ✭ 128 (+255.56%)
Mutual labels:  customizable
Butterfly
🎨 Powerful, minimalistic, cross-platform, opensource note-taking app
Stars: ✭ 381 (+958.33%)
Mutual labels:  customizable
twitch2dcs
DCS World mod that allows twitch chat to be viewed inside the game
Stars: ✭ 24 (-33.33%)
Mutual labels:  customizable
ctxmenu
Tiny and customizable context menu generator
Stars: ✭ 20 (-44.44%)
Mutual labels:  customizable
react-native-tab-bars
Fully customizable navigation tab bar for React Native
Stars: ✭ 16 (-55.56%)
Mutual labels:  customizable
wui
Collection of GUI widgets for the web
Stars: ✭ 44 (+22.22%)
Mutual labels:  customizable
HoloUI
A clean and highly customizable UI for payday 2
Stars: ✭ 18 (-50%)
Mutual labels:  customizable
Simple-Game-ERC-721-Token-Template
🔮 Very Simple ERC-721 Smart Contract Template to create your own ERC-721 Tokens on the Ethereum Blockchain, with many customizable Options 🔮
Stars: ✭ 83 (+130.56%)
Mutual labels:  customizable
react-native-bottom-bar
Fully customizable BottomBar with unique design shape for React Native.
Stars: ✭ 74 (+105.56%)
Mutual labels:  customizable
Whatsapp-Chat-Exporter
A customizable Android and iPhone WhatsApp database parser that will give you the history of your WhatsApp conversations in HTML and JSON. Android Backup Crypt12, Crypt14 and Crypt15 supported.
Stars: ✭ 150 (+316.67%)
Mutual labels:  customizable
react-native-floating-label-input
A customizable React Native TextInput with its placeholder always shown. Includes masks, global styles, character count, and a bunch else.
Stars: ✭ 206 (+472.22%)
Mutual labels:  customizable
heimdall
A highly customisable discord bot that assigns users roles based on different invite links
Stars: ✭ 19 (-47.22%)
Mutual labels:  customizable
QmlTreeWidget
A TreeView component, implemented by QML, providing convenient interfaces and customizable stylesheet, also available for iOS and Android.
Stars: ✭ 34 (-5.56%)
Mutual labels:  customizable
SJLineRefresh
pull-to-refresh by line path
Stars: ✭ 36 (+0%)
Mutual labels:  customizable
react-native-slider-intro
A simple and fully customizable React Native component that implements an intro slider for your app
Stars: ✭ 80 (+122.22%)
Mutual labels:  customizable

Dumpling

Build Status Version License Platform Carthage compatible

Dumpling is a pure Swift customisable and extensible Markdown parser for iOS, macOS and Linux.

Features

  • 100% Swift
  • Easy to extend with new markdown tags, output formats or customise existing implementations.
  • Intermediate layer describing document structure with Abstract Syntax Tree
  • Build-in support for rendering outputs as the Plain Text, HTML, NSAttributedString.
  • Multiplatform - iOS, macOS, Linux.

Internal architecture

Dumpling uses a highly extensible and modular functional approach called parser combinator.

Markdown parser produces an intermediate data model called Abstract Syntax Tree (AST).

Renderer implementations use AST to produce the final output. Dumpling provides 3 main build-in output formats - Plain Text, HTML and NSAttributedString.

Supported Elements

*italic* or _italics_ 
**bold** or __bold__ 
~~strikethrough~~ 

# Header 1
## Header 2
### Header 3
#### Header 4
##### Header 5
###### Header 6

Horizontal lines (Thematic breaks)

***
---
___
* * *   *
-----------------


* List
  - List
+ List

1. Ordered 
1. Lists with **style**

Inline `code` or 
``` 
block code
```
[Links](http://github.com/chojnac/)

> Blockquotes
> > and  nested blockquote.
>
> ## With nested content 
> 1.   This is the **first** list ~~item~~.
> 2.   This is the *second* list item.

Please note that the goal of this project was to create a foundation for a flexible Markdown parser. Dumpling doesn't fully support all Markdown specs. This is a very young implementation so it covers only the most common set of Markdown features.

Installation

CocoaPods

pod 'Dumpling'

Carthage

github "chojnac/Dumpling.git" ~> 0.3.0

Swift Package Manager

dependencies: [
    .package(url: "https://github.com/chojnac/Dumpling.git", .upToNextMajor(from: "0.3.0"))
]

Usage

Basic usage

Parse text and produce html:

import Dumpling 

let text = "**Lorem ipsum**"
let html = Markdown().parse(text).renderHTML()

or NSAttributedText:

import Dumpling 

let text = "**Lorem ipsum**"
let string = Markdown().parse(text).renderAttributedString()

Change NSAttributedText style

import Dumpling 

let theme = AttributedStringTheme(
   baseFont: .systemFont(ofSize: 13),
   color: .blue
)

theme.addStyle(
    forKey: .strong,
    style: StringStyle.foregroundColor(Color.red)
)

theme.addStyle(
    forKey: .em,
    style: compose(
        StringStyle.foregroundColor(Color.green),
        StringStyle.traits([.italic])
    )
)

let string = Markdown()
        .parse(text)
        .renderAttributedString(theme: theme)

You will find more advanced examples in the project example playground

License

Dumpling is available under the MIT license. See the LICENSE file for more info.

Markdown test document used in the project based on Max Stoiber's Markdown Test File

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].