|
@@ -6,6 +6,7 @@ SwiftyMarkdown converts Markdown files and strings into `NSAttributedString`s us
|
|
- [Installation](#installation)
|
|
- [Installation](#installation)
|
|
- [How to Use](#how-to-use-swiftymarkdown)
|
|
- [How to Use](#how-to-use-swiftymarkdown)
|
|
- [Screenshot](#screenshot)
|
|
- [Screenshot](#screenshot)
|
|
|
|
+- [Front Matter](#front-matter)
|
|
- [Appendix](#appendix)
|
|
- [Appendix](#appendix)
|
|
|
|
|
|
## Fully Rebuilt For 2020!
|
|
## Fully Rebuilt For 2020!
|
|
@@ -64,27 +65,27 @@ label.attributedText = md.attributedString()
|
|
|
|
|
|
*italics* or _italics_
|
|
*italics* or _italics_
|
|
**bold** or __bold__
|
|
**bold** or __bold__
|
|
|
|
+ ~~Linethrough~~Strikethroughs.
|
|
|
|
+ `code`
|
|
|
|
|
|
# Header 1
|
|
# Header 1
|
|
|
|
|
|
or
|
|
or
|
|
|
|
|
|
- Header 1
|
|
|
|
- ====
|
|
|
|
|
|
+ Header 1
|
|
|
|
+ ====
|
|
|
|
|
|
## Header 2
|
|
## Header 2
|
|
|
|
|
|
or
|
|
or
|
|
|
|
|
|
- Header 2
|
|
|
|
- ---
|
|
|
|
|
|
+ Header 2
|
|
|
|
+ ---
|
|
|
|
|
|
### Header 3
|
|
### Header 3
|
|
#### Header 4
|
|
#### Header 4
|
|
##### Header 5 #####
|
|
##### Header 5 #####
|
|
###### Header 6 ######
|
|
###### Header 6 ######
|
|
-
|
|
|
|
- `code`
|
|
|
|
|
|
|
|
Indented code blocks (spaces or tabs)
|
|
Indented code blocks (spaces or tabs)
|
|
|
|
|
|
@@ -95,6 +96,10 @@ label.attributedText = md.attributedString()
|
|
|
|
|
|
- Bulleted
|
|
- Bulleted
|
|
- Lists
|
|
- Lists
|
|
|
|
+ - Including indented lists
|
|
|
|
+ - Up to three levels
|
|
|
|
+ - Neat!
|
|
|
|
+
|
|
|
|
|
|
Compound rules also work, for example:
|
|
Compound rules also work, for example:
|
|
|
|
|
|
@@ -102,7 +107,7 @@ Compound rules also work, for example:
|
|
|
|
|
|
Or [**Bold Links**](http://voyagetravelapps.com/)
|
|
Or [**Bold Links**](http://voyagetravelapps.com/)
|
|
|
|
|
|
-Images will be inserted into the returned `NSAttributedString` as an `NSTextAttachment` (sadly, this will not work on watchOS as `NSTextAttachment` is not available).
|
|
|
|
|
|
+Images will be inserted into the returned `NSAttributedString` as an `NSTextAttachment` (sadly, this will not work on watchOS as `NSTextAttachment` is not available).
|
|
|
|
|
|
## Customisation
|
|
## Customisation
|
|
|
|
|
|
@@ -119,6 +124,8 @@ md.h1.alignmnent = .center
|
|
md.italic.color = UIColor.blueColor()
|
|
md.italic.color = UIColor.blueColor()
|
|
|
|
|
|
md.underlineLinks = true
|
|
md.underlineLinks = true
|
|
|
|
+
|
|
|
|
+md.bullet = "🍏"
|
|
```
|
|
```
|
|
|
|
|
|
On iOS, Specified font sizes will be adjusted relative to the the user's dynamic type settings.
|
|
On iOS, Specified font sizes will be adjusted relative to the the user's dynamic type settings.
|
|
@@ -129,6 +136,10 @@ On iOS, Specified font sizes will be adjusted relative to the the user's dynamic
|
|
|
|
|
|
There's an example project included in the repository. Open the `.xcworkspace` file to get started.
|
|
There's an example project included in the repository. Open the `.xcworkspace` file to get started.
|
|
|
|
|
|
|
|
+## Front Matter
|
|
|
|
+
|
|
|
|
+SwiftyMarkdown recognises YAML front matter and will populate the `frontMatterAttributes` property with the key-value pairs that it fines.
|
|
|
|
+
|
|
## Appendix
|
|
## Appendix
|
|
|
|
|
|
### A) All Customisable Properties
|
|
### A) All Customisable Properties
|
|
@@ -202,7 +213,14 @@ code.fontSize : CGFloat
|
|
code.color : UI/NSColor
|
|
code.color : UI/NSColor
|
|
code.fontStyle : FontStyle
|
|
code.fontStyle : FontStyle
|
|
|
|
|
|
|
|
+strikethrough.fontName : String
|
|
|
|
+strikethrough.fontSize : CGFloat
|
|
|
|
+strikethrough.color : UI/NSColor
|
|
|
|
+strikethrough.fontStyle : FontStyle
|
|
|
|
+
|
|
underlineLinks : Bool
|
|
underlineLinks : Bool
|
|
|
|
+
|
|
|
|
+bullet : String
|
|
```
|
|
```
|
|
|
|
|
|
`FontStyle` is an enum with these cases: `normal`, `bold`, `italic`, and `bolditalic` to give you more precise control over how lines and character styles should look.
|
|
`FontStyle` is an enum with these cases: `normal`, `bold`, `italic`, and `bolditalic` to give you more precise control over how lines and character styles should look.
|
|
@@ -333,4 +351,4 @@ let label = SKLabelNode()
|
|
label.preferredMaxLayoutWidth = 500
|
|
label.preferredMaxLayoutWidth = 500
|
|
label.numberOfLines = 0
|
|
label.numberOfLines = 0
|
|
label.attributedText = smd.attributedString()
|
|
label.attributedText = smd.attributedString()
|
|
-```
|
|
|
|
|
|
+```
|