1- # TOONEncoder β TOON Format for Swift
1+ # TOON Format for Swift
22
33[ ![ CI] ( https://github.com/toon-format/toon-swift/actions/workflows/ci.yml/badge.svg )] ( https://github.com/toon-format/toon-swift/actions )
44[ ![ Swift Version] ( https://img.shields.io/badge/swift-6.0+-orange.svg )] ( https://swift.org )
@@ -14,6 +14,7 @@ TOON saves tokens while remaining human-readable by
1414using indentation for structure and a tabular format for uniform data:
1515
1616** JSON** :
17+
1718``` json
1819{
1920 "users" : [
@@ -24,6 +25,7 @@ using indentation for structure and a tabular format for uniform data:
2425```
2526
2627** TOON** :
28+
2729```
2830users[2]{id,name,role}:
2931 1,Alice,admin
@@ -53,8 +55,8 @@ and implements the following features:
5355
5456## Requirements
5557
56- * Swift 6.0+ / Xcode 16+
57- * iOS 13.0+ / macOS 10.15+ / watchOS 6.0+ / tvOS 13.0+ / visionOS 1.0+
58+ - Swift 6.0+ / Xcode 16+
59+ - iOS 13.0+ / macOS 10.15+ / watchOS 6.0+ / tvOS 13.0+ / visionOS 1.0+
5860
5961## Installation
6062
@@ -73,7 +75,7 @@ dependencies: [
7375### Quick Start
7476
7577``` swift
76- import TOONEncoder
78+ import ToonFormat
7779
7880struct User : Codable {
7981 let id: Int
@@ -95,6 +97,7 @@ print(String(data: data, encoding: .utf8)!)
9597```
9698
9799Output:
100+
98101```
99102id: 123
100103name: Ada
@@ -126,13 +129,15 @@ let data = try encoder.encode(["items": items])
126129```
127130
128131Output with tab delimiter:
132+
129133```
130134items[2 ]{sku name qty price}:
131135 A1 Widget 2 9.99
132136 B2 Gadget 1 14.5
133137```
134138
135139Output with pipe delimiter:
140+
136141```
137142items[2|]{sku|name|qty|price}:
138143 A1|Widget|2|9.99
@@ -159,6 +164,7 @@ let output = try encoder.encode(data)
159164```
160165
161166Output:
167+
162168```
163169tags[#3]: reading,gaming,coding
164170items[#2]{sku,qty,price}:
@@ -187,6 +193,7 @@ let data = try encoder.encode(["items": items])
187193```
188194
189195Output:
196+
190197```
191198items[2]{sku,qty,price}:
192199 A1,2,9.99
@@ -205,6 +212,7 @@ let data = try encoder.encode(["pairs": pairs])
205212```
206213
207214Output:
215+
208216```
209217pairs[2]:
210218 - [2]: 1,2
@@ -238,6 +246,7 @@ let data = try encoder.encode(config)
238246```
239247
240248Without key folding:
249+
241250```
242251database:
243252 connection:
@@ -320,6 +329,7 @@ print(TOONEncoder.specVersion) // "3.0"
320329Contributions are welcome! Please read our [ Contributing Guide] ( CONTRIBUTING.md ) for details on how to get started, coding standards, and the process for submitting pull requests.
321330
322331Before contributing, please review:
332+
323333- [ Code of Conduct] ( CODE_OF_CONDUCT.md )
324334- [ TOON Specification] ( https://github.com/toon-format/spec/blob/main/SPEC.md )
325335
0 commit comments