LiterateSwiftGUI

by chriseidhof

chriseidhof / LiterateSwiftGUI
126 Stars 5 Forks Last release: over 5 years ago (0.0.1) 32 Commits 1 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

LiterateSwift is a (GUI) tool to edit your literate swift files.

A literate swift file is written in CommonMark, written with fenced code blocks. A code block can be either of three things: swift, highlight-swift, or print-swift.

A file is transformed like this: first, all

swift
code-blocks are assembled into one big swift file. Then, for every print-swift block, a new file is generated, containing the
swift
code blocks and the contents of that print-swift block.

To install, just run

pod install
, it will install the dependencies (cmark, CommonMark and LiterateSwift). For
cmark
, you need to have
cmake
installed. All code is written using the latest Xcode (Xcode 7, Beta 4).

Weaving

Additionally, you can include snippets from other swift files in subdirectories (or the same directory).

If you surround your code like this:

// <>
class View {
    var window: Window
    init(window: Window) {
        self.window = window
    }
}
class Window {
    var view: View?
}
// <>

And put it in a file with the extension .swift, somewhere in the same directory as the markdown file (or a subdirectory), you can then include it in your Markdown file, inside a code block:

```highlight-swift
<>
```

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.