FountainEditorKit.git · README.md
FountainEditorKit.git / README.md
revision 02bb5ddf56beec015d5c3fe77253441c03b5e3a8 · complete file
# FountainEditorKit
Reusable Fountain screenplay editor surface for macOS (SwiftUI/AppKit), plus deterministic parsing and highlighting utilities.

## Usage
```swift
import FountainEditorKit
import SwiftUI
struct Demo: View {
@State private var text: String = ""
var body: some View {
FountainEditor(text: $text)
}
}
```
## Namespaced Fountain extensions
FountainEditorKit recognizes explicit, namespaced extensions embedded in ordinary Fountain notes. Unknown or malformed extensions remain notes, so a consumer that does not understand an extension still preserves the exact source.
```fountain
[[fountain:presentation
{
"cards" : [],
"schemaVersion" : 1
}
]]
```
Use `FountainExtensionParser` for generic extensions. For Copilot-style source, consent, and audit cards, use the versioned presentation codec and reusable view:
```swift
let source = try FountainPresentationCodec.encode(document)
let decoded = try FountainPresentationCodec.decodeFirst(in: source)
if let decoded {
FountainPresentationView(document: decoded)
}
```
`FountainPresentationDocument.plainText` is the complete, non-truncating fallback for copy, accessibility, logging, and hosts that do not render cards. The visible card keeps findings and citations prominent while retaining every retrieval endpoint and outcome in an accessible disclosure; complete source responses remain available in individually addressable nested disclosures.
## Development
- `swift test`