Sources/OrgPrograms/Programs.swift

18 lines · 628 bytes

 1#if os(macOS)
 2import Foundation
 3import OrgApp
 4import OrgCore
 5
 6/// Babel and Emacs as processes, for `DocumentSession.programs`.
 7public struct Programs: ProgramRunning {
 8    public init() {}
 9
10    public func runBabel(_ job: BabelJob, fileDirectory: URL) async throws -> BabelOutput {
11        try await BabelRunner.run(job, fileDirectory: fileDirectory)
12    }
13
14    public func recalculateTable(text: String, directory: URL, table: Range<Int>, point: Int, form: String) async throws -> String {
15        try await EmacsRunner.recalculateTable(text: text, directory: directory, table: table, point: point, form: form)
16    }
17}
18#endif