Skip to content

orgapp/swift-org

Repository files navigation

SwiftOrg

org-mode Parser for Swift

https://travis-ci.org/xiaoxinghu/swift-org.svg?branch=master https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000 https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat https://img.shields.io/github/release/xiaoxinghu/swift-org.svg?maxAge=2592000

org-mode is awesome. This is the first step to bring it to iOS, (arguably) the most popular platform on the planet.

Usage

An simple example will explain everything.

import SwiftOrg

let lines = [
    "* TODO head line",
    "  A normal line here.",
]
let parser = OrgParser()
let doc = try parser.parse(lines: lines)

Supported Syntax (so far) [17/19]

Affiliated Keywords (aka In Buffer Settings)

#+TITLE: Hello World
#+OPTIONS: Hello World

Headlines

* Head Line 1
* Head Line 2
** Head Line 2.1
*** Head Line 2.1.1

TODO Keywords

#+TODO: TODO NEXT | DONE

* TODO Head Line 1
* NEXT Head Line 2
** DONE Head Line 2.1
   CLOSED: [2016-12-31 Sat 14:12]

[#A] Priority

* TODO [#A] Top Priority Task
* [#B] Medium Priority Item
* TODO [#c] Low Priority Task
* TODO [#D] No Priority Task

Tags

* Section with One Tag                                                :tag1:
* Section with multiple tags                                 :tag1:tag2:tag3:

Planning

* DONE Closed task
  CLOSED: [2017-01-09 Mon 15:58]

* Scheduled task
  SCHEDULED: <2017-01-09 Mon>

* TODO task that has a deadline
  DEADLINE: <2017-01-16 Mon +1w>

Paragraph

Lines without line breaker becomes a paragraph.

Emphasis

*bold*
/italic/
_underlined_
=verbatim=
~code~
+strike-through+

Link

[[google][https://www.google.com]]

List

# ordered list
1. first
2) second
3. 3rd

# unordered list
- item
+ item
* item

# nested list
- item
  1. sub item
  1) sub item
- item

Horizontal rules

Above.
-----
Below

Comment

# This is a comment.
#This is a regular line.

Blocks

#+BEGIN_SRC javascript
  Console.log("Hello Org.")
#+END_SRC

#+BEGIN_QUOTE
Everything should be made as simple as possible,
but not any simpler -- Albert Einstein
#+END_QUOTE

Drawer

Drawer for headlines.

* WAITING Talk to Jake
  :PROPERTIES:
  :CATEGORY: personal
  :END:
  :LOGBOOK:
State "WAITING"    from "TODO"       [2016-09-20 Tue 22:41] \\
    waiting for call from Jake
  :END:

Footnote

This is a footnote right here[fn:1]. And this is the rest.

[fn:1] The content of the footnote here.

Checkbox

Checkboxes in list items.
- [X] item one checked
- [-] item two not checked
- [ ] item three not checked

Table

| Name         | Species    | Gender | Role         |
|--------------+------------+--------+--------------|
| Bruce Wayne  | Human      | M      | Batman       |
| Clark Kent   | Kryptonian | M      | Superman     |
| Diana Prince | Amazonian  | F      | Wonder Woman |

Clock

Attachments

[#c] Maybe? [0/2]

  • [ ] Latex Support
  • [ ] Macros

Performance Test

Contribute

SwiftOrg is written in Swift 3. So you need xcode 8 to be able to build it.

Setup

./bin/setup
./bin/test

Release

To bump up version number.

agvtool new-marketing-version 0.7.9
sed -i.bak "s/s\.version = .*/s\.version = '0\.7\.9'/" SwiftOrg.podspec

License

Carthage is released under the MIT LIcense.