-
Notifications
You must be signed in to change notification settings - Fork 7
/
README.swift
51 lines (39 loc) · 1.32 KB
/
README.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//: # Playdown
//: **Playdown** — *noun*: A place where people convert Swift Playgrounds to Markdown
println("This README was converted from README.swift!")
/*:
# Usage
Playdown was made to be run from the Terminal.
Install with npm, and run Playdown on any Swift file
```
$ npm install -g playdown
$ playdown Contents.swift
```
Alternatively, you can download `Playdown.swift`, put it in the right directory, and run it with `swift Playdown.swift Contents.swift`.
*/
func use() {
npm.install("playdown", options: "-g")
Terminal.run("playdown Contents.swift") // Works for any .swift file!
}
/*:
# Features
* Convert a playground to a Markdown document, perfect for blog posts
* Support for lots of Markdown features, like headings, lists, block quotes, styles, and links.
* Supports Github Flavored Markdown
*/
func cool() -> Bool {
return Playdown.headings()
.lists()
.blockQuote()
.codeBlocks()
.inlineStyles()
.links() == true
}
/*:
# Tests
If Playdown doesn't work well for one of your playgrounds, please open a pull request with your playground and the expected output.
To run the tests, you can use the `test` script in the root folder of this project.
*/
func test() -> (Test, String) {
return (./test, "We would love if you contributed more tests!")
}