Commit 2986af1074

2986af1074ecbcd8b4975e0e046c502117a6c4f9

parent: 68d23899b0

Verified · cmc

cmc <hello@cleberg.net> · 2026-11-22 07:38 UTC

Export: per-file settings, and subtree and body-only for the export commands

Closes #112

Layout: unified · split

Sources/OrgApp/CommandTitles.swift +2
@@ -314,6 +314,8 @@ enum CommandTitles {
314314 String(localized: "Transpose Table", comment: "Command title"),
315315 String(localized: "Truncate or Wrap Long Lines", comment: "Command title"),
316316 String(localized: "Turn Auto Fill On or Off", comment: "Command title"),
317 String(localized: "Turn Body-Only Export On or Off", comment: "Command title"),
318 String(localized: "Turn Subtree Export On or Off", comment: "Command title"),
317319 String(localized: "Underline", comment: "Command title"),
318320 String(localized: "Undo", comment: "Command title"),
319321 String(localized: "Unset Attachment Folder", comment: "Command title"),
Sources/OrgApp/ExportSettings.swift added +68
@@ -0,0 +1,68 @@
1import Foundation
2
3/// A file's export choices: what the export dialog shows for it, and the scope and body-only
4/// choice its single-format export commands follow, as `C-s` and `C-b` in Org's dispatcher.
5/// Kept in the defaults by the file's path.
6public struct ExportSettings: Codable, Equatable, Sendable {
7 public var format = "html"
8 /// The subtree at the caret, not the whole file.
9 public var subtree = false
10 public var bodyOnly = false
11 public var openAfter = false
12
13 public static let key = "exportSettings"
14 /// Shown when body only is on and the format is a whole document.
15 public static let noBodyOnly = "This format has no body-only export. Turn body-only export off for this file first."
16
17 public init() {}
18
19 /// PDF, Word, RTF, plain text, ODT and iCalendar are whole documents.
20 public static func allowsBodyOnly(_ format: String) -> Bool {
21 !["pdf", "print-pdf", "odt", "docx", "rtf", "plain-text", "icalendar"].contains(format)
22 }
23
24 /// The settings kept for the file at `path`. Without any: the format and open-after choice
25 /// last exported with, the whole file, and the whole document.
26 public static func saved(for path: String, defaults: UserDefaults = .standard) -> ExportSettings {
27 if let kept = all(defaults)[path] { return kept }
28 var settings = ExportSettings()
29 settings.format = defaults.string(forKey: "exportFormat") ?? settings.format
30 settings.openAfter = defaults.bool(forKey: "exportOpenAfter")
31 return settings
32 }
33
34 /// Keeps the settings for the file at `path`; with `lastUsed`, the format and open-after
35 /// choice also become what a file without settings starts with.
36 public func save(for path: String, lastUsed: Bool = false, defaults: UserDefaults = .standard) {
37 var all = Self.all(defaults)
38 all[path] = self
39 if let data = try? JSONEncoder().encode(all) { defaults.set(data, forKey: Self.key) }
40 guard lastUsed else { return }
41 defaults.set(format, forKey: "exportFormat")
42 defaults.set(openAfter, forKey: "exportOpenAfter")
43 }
44
45 /// The scope and body-only choice a single-format export command follows for `format`. Nil
46 /// when body only is on and the format has none. The agenda files' calendars are not the
47 /// file's export, so they follow neither.
48 public func commandOptions(_ format: String) -> (subtree: Bool, bodyOnly: Bool)? {
49 if format.hasPrefix("icalendar-") { return (false, false) }
50 guard !bodyOnly || Self.allowsBodyOnly(format == "html-open" ? "html" : format) else { return nil }
51 return (subtree, bodyOnly)
52 }
53
54 /// The message after an export to the file named `name`, saying what was exported when it
55 /// was not the whole file as a whole document.
56 public static func exported(_ name: String, subtree: Bool, bodyOnly: Bool) -> String {
57 switch (subtree, bodyOnly) {
58 case (true, true): "Exported the subtree's body to \(name)"
59 case (true, false): "Exported the subtree to \(name)"
60 case (false, true): "Exported the body to \(name)"
61 case (false, false): "Exported to \(name)"
62 }
63 }
64
65 private static func all(_ defaults: UserDefaults) -> [String: ExportSettings] {
66 defaults.data(forKey: key).flatMap { try? JSONDecoder().decode([String: ExportSettings].self, from: $0) } ?? [:]
67 }
68}
Sources/OrgCore/Keymap/PresetEmacs.swift +6
@@ -470,6 +470,12 @@ extension KeymapPreset {
470470 keys = "C-c C-x C-z"
471471 command = "app.clock.resolve"
472472 [[bind]]
473 keys = "C-c C-e C-s"
474 command = "app.export-subtree"
475 [[bind]]
476 keys = "C-c C-e C-b"
477 command = "app.export-body-only"
478 [[bind]]
473479 keys = "C-c C-e h h"
474480 command = "app.export.html"
475481 [[bind]]
Sources/OrgEditorAppKit/EditorCommands.swift +2
@@ -164,6 +164,8 @@ public enum EditorCommands {
164164 EditorCommand(id: "app.crypt.encrypt-entries", title: "Encrypt Tagged Entries…", action: .app),
165165 EditorCommand(id: "app.crypt.forget-passphrase", title: "Forget Encryption Passphrase", action: .app),
166166 EditorCommand(id: "app.export-dialog", title: "Export…", action: .app),
167 EditorCommand(id: "app.export-subtree", title: "Turn Subtree Export On or Off", action: .app),
168 EditorCommand(id: "app.export-body-only", title: "Turn Body-Only Export On or Off", action: .app),
167169 EditorCommand(id: "app.sync-conflicts", title: "Resolve Sync Conflicts…", action: .app),
168170 EditorCommand(id: "app.revert", title: "Revert to File on Disk", action: .app),
169171 EditorCommand(id: "app.recovery", title: "Recovery Versions…", action: .app),
Sources/Orgstar/ContentView.swift +26 −11
@@ -620,7 +620,7 @@ struct ContentView: View {
620620 do {
621621 let target = try ICalendarFiles.export(whole, path: path, settings: defaults, options: OrgPreferences.icalendarOptions(),
622622 subtree: subtree ? caret : nil, destination: destination)
623 commands.show("Exported to \(target.lastPathComponent)")
623 commands.show(ExportSettings.exported(target.lastPathComponent, subtree: subtree, bodyOnly: bodyOnly))
624624 if open { NSWorkspace.shared.open(target) }
625625 } catch {
626626 commands.show("Can't export: \(error.localizedDescription)")
@@ -637,16 +637,16 @@ struct ContentView: View {
637637 do {
638638 try FileManager.default.createDirectory(at: target.deletingLastPathComponent(), withIntermediateDirectories: true)
639639 try content.write(to: target, atomically: true, encoding: .utf8)
640 commands.show("Exported to \(target.lastPathComponent)")
640 commands.show(ExportSettings.exported(target.lastPathComponent, subtree: subtree, bodyOnly: bodyOnly))
641641 if open { NSWorkspace.shared.open(target) }
642642 } catch {
643643 commands.show("Can't write \(target.lastPathComponent): \(error.localizedDescription)")
644644 }
645 case "latex" where exportNative("LaTeX", extension: "tex", whole: whole, url: url, to: destination, open: open, subtree: subtree ? caret : nil, settings: defaults, export: {
645 case "latex" where exportNative("LaTeX", extension: "tex", whole: whole, url: url, to: destination, open: open, subtree: subtree ? caret : nil, bodyOnly: bodyOnly, settings: defaults, export: {
646646 try LaTeXExport.document(text, settings: defaults, path: path, bodyOnly: bodyOnly, author: NSFullUserName(), language: OrgPreferences.exportLanguage(), file: true)
647647 }):
648648 break
649 case "text" where exportNative("plain text", extension: "txt", whole: whole, url: url, to: destination, open: open, subtree: subtree ? caret : nil, settings: defaults, export: {
649 case "text" where exportNative("plain text", extension: "txt", whole: whole, url: url, to: destination, open: open, subtree: subtree ? caret : nil, bodyOnly: bodyOnly, settings: defaults, export: {
650650 try ASCIIExport.document(text, settings: defaults, path: path, bodyOnly: bodyOnly, author: NSFullUserName(), language: OrgPreferences.exportLanguage(), file: true)
651651 }):
652652 break
@@ -659,7 +659,7 @@ struct ContentView: View {
659659 let data = try ODTExport.document(text, settings: defaults, path: path, author: NSFullUserName(), language: OrgPreferences.exportLanguage())
660660 try FileManager.default.createDirectory(at: target.deletingLastPathComponent(), withIntermediateDirectories: true)
661661 try data.write(to: target, options: .atomic)
662 commands.show("Exported to \(target.lastPathComponent)")
662 commands.show(ExportSettings.exported(target.lastPathComponent, subtree: subtree, bodyOnly: bodyOnly))
663663 if open { NSWorkspace.shared.open(target) }
664664 } catch {
665665 commands.show("Can't export \(target.lastPathComponent): \(error.localizedDescription)")
@@ -687,7 +687,7 @@ struct ContentView: View {
687687 }
688688 try FileManager.default.createDirectory(at: target.deletingLastPathComponent(), withIntermediateDirectories: true)
689689 try data.write(to: target, options: .atomic)
690 commands.show("Exported to \(target.lastPathComponent)")
690 commands.show(ExportSettings.exported(target.lastPathComponent, subtree: subtree, bodyOnly: bodyOnly))
691691 if open { NSWorkspace.shared.open(target) }
692692 } catch {
693693 commands.show("Can't export \(target.lastPathComponent): \(error)")
@@ -710,7 +710,7 @@ struct ContentView: View {
710710 try FileManager.default.moveItem(at: written, to: destination)
711711 written = destination
712712 }
713 commands.show("Exported to \(written.lastPathComponent)")
713 commands.show(ExportSettings.exported(written.lastPathComponent, subtree: subtree, bodyOnly: bodyOnly))
714714 if open { NSWorkspace.shared.open(written) }
715715 } catch is CancellationError {
716716 commands.show("Export canceled")
@@ -728,7 +728,7 @@ struct ContentView: View {
728728 /// Writes what `export` makes, as ox does for `format`. False when the native export can't
729729 /// match Emacs and Emacs is installed to export instead; otherwise the reason is shown.
730730 private func exportNative(
731 _ format: String, extension ext: String, whole: String, url: URL, to destination: URL?, open: Bool, subtree: Int?, settings: OrgSettings,
731 _ format: String, extension ext: String, whole: String, url: URL, to destination: URL?, open: Bool, subtree: Int?, bodyOnly: Bool, settings: OrgSettings,
732732 export: () throws -> String
733733 ) -> Bool {
734734 let content: String
@@ -746,7 +746,7 @@ struct ContentView: View {
746746 do {
747747 try FileManager.default.createDirectory(at: target.deletingLastPathComponent(), withIntermediateDirectories: true)
748748 try content.write(to: target, atomically: true, encoding: .utf8)
749 commands.show("Exported to \(target.lastPathComponent)")
749 commands.show(ExportSettings.exported(target.lastPathComponent, subtree: subtree != nil, bodyOnly: bodyOnly))
750750 if open { NSWorkspace.shared.open(target) }
751751 } catch {
752752 commands.show("Can't write \(target.lastPathComponent): \(error.localizedDescription)")
@@ -1243,7 +1243,7 @@ struct ContentView: View {
12431243 return commands.show(Self.unavailable(EditorCommands.all.first { $0.id == id }?.title ?? id))
12441244 }
12451245 if let feature = ProFeature.required(byCommand: id), !ProAccess.shared.allows(feature) { return }
1246 let orgOnly = ["app.refile", "app.refile.copy", "app.archive", "app.clock.in", "app.clock.default", "app.copy-rich-text"].contains(id) || (id.hasPrefix("app.export.") && !id.hasPrefix("app.export.icalendar-")) || id.hasPrefix("org.")
1246 let orgOnly = ["app.refile", "app.refile.copy", "app.archive", "app.clock.in", "app.clock.default", "app.copy-rich-text", "app.export-subtree", "app.export-body-only"].contains(id) || (id.hasPrefix("app.export.") && !id.hasPrefix("app.export.icalendar-")) || id.hasPrefix("org.")
12471247 if orgOnly, !session.isOrg {
12481248 commands.show("Not an org file")
12491249 return
@@ -1438,8 +1438,23 @@ struct ContentView: View {
14381438 case "app.export-dialog":
14391439 guard let path = session.path else { return commands.show("No file is open") }
14401440 panel = .export(UUID(), URL(fileURLWithPath: path))
1441 case "app.export-subtree", "app.export-body-only":
1442 guard let path = session.path else { return commands.show("No file is open") }
1443 var settings = ExportSettings.saved(for: path)
1444 if id == "app.export-subtree" {
1445 settings.subtree.toggle()
1446 commands.show(settings.subtree ? "Export commands: subtree at the caret" : "Export commands: whole file")
1447 } else {
1448 settings.bodyOnly.toggle()
1449 commands.show(settings.bodyOnly ? "Export commands: body only" : "Export commands: whole document")
1450 }
1451 settings.save(for: path)
14411452 case let id where id.hasPrefix("app.export."):
1442 export(String(id.dropFirst("app.export.".count)))
1453 let format = String(id.dropFirst("app.export.".count))
1454 guard let options = (session.path.map { ExportSettings.saved(for: $0) } ?? ExportSettings()).commandOptions(format) else {
1455 return commands.show(ExportSettings.noBodyOnly)
1456 }
1457 export(format, subtree: options.subtree, bodyOnly: options.bodyOnly)
14431458 case let id where id.hasPrefix("app.publish"):
14441459 publish(id)
14451460 case "app.plot":
Sources/Orgstar/ExportSheet.swift +27 −7
@@ -1,4 +1,5 @@
11import AppKit
2import OrgApp
23import SwiftUI
34
45/// Export… (`app.export-dialog`): the format, where the file goes, and whether to open it after.
@@ -11,16 +12,32 @@ struct ExportSheet: View {
1112 /// Without a chosen destination, the App Store build passes nil, and the export asks where
1213 /// to write when the default is outside the sandbox's reach.
1314 let export: (_ format: String, _ destination: URL?, _ open: Bool, _ subtree: Bool, _ bodyOnly: Bool) -> Void
14 @AppStorage("exportFormat") private var format = "html"
15 @AppStorage("exportOpenAfter") private var openAfter = false
16 @AppStorage("exportBodyOnly") private var bodyOnly = false
15 /// The file's settings, kept when it is exported.
16 @State private var format: String
17 @State private var openAfter: Bool
18 @State private var bodyOnly: Bool
19 @State private var subtree: Bool
1720 @AppStorage("pdfMargin") private var pdfMargin = 50
1821 @AppStorage("pdfFont") private var pdfFont = ""
1922 @AppStorage("pdfPageNumbers") private var pdfPageNumbers = true
20 @State private var subtree = false
2123 @State private var destination: URL?
2224 @Environment(\.dismiss) private var dismiss
2325
26 init(
27 source: URL, inSubtree: Bool, target: @escaping (_ ext: String, _ subtree: Bool) -> URL,
28 export: @escaping (_ format: String, _ destination: URL?, _ open: Bool, _ subtree: Bool, _ bodyOnly: Bool) -> Void
29 ) {
30 self.source = source
31 self.inSubtree = inSubtree
32 self.target = target
33 self.export = export
34 let saved = ExportSettings.saved(for: source.path)
35 _format = State(initialValue: saved.format)
36 _openAfter = State(initialValue: saved.openAfter)
37 _bodyOnly = State(initialValue: saved.bodyOnly)
38 _subtree = State(initialValue: saved.subtree)
39 }
40
2441 #if APPSTORE
2542 static let formats: [(id: String, title: String, ext: String)] = [
2643 ("html", "HTML", "html"), ("markdown", "Markdown", "md"), ("print-pdf", "PDF", "pdf"), ("docx", "Word", "docx"),
@@ -37,9 +54,9 @@ struct ExportSheet: View {
3754 #endif
3855
3956 private var ext: String { Self.formats.first { $0.id == format }?.ext ?? "html" }
40 private var chosen: URL { destination ?? target(ext, subtree) }
57 private var chosen: URL { destination ?? target(ext, subtree && inSubtree) }
4158 /// PDF and ODT are whole documents.
42 private var allowsBodyOnly: Bool { !["pdf", "print-pdf", "odt", "docx", "rtf", "plain-text", "icalendar"].contains(format) }
59 private var allowsBodyOnly: Bool { ExportSettings.allowsBodyOnly(format) }
4360
4461 var body: some View {
4562 Form {
@@ -47,7 +64,7 @@ struct ExportSheet: View {
4764 ForEach(Self.formats, id: \.id) { Text($0.title).tag($0.id) }
4865 }
4966 .onChange(of: format) { destination = destination.map { $0.deletingPathExtension().appendingPathExtension(ext) } }
50 Picker("Scope", selection: $subtree) {
67 Picker("Scope", selection: Binding(get: { subtree && inSubtree }, set: { subtree = $0 })) {
5168 Text("Whole file").tag(false)
5269 Text("Subtree at the caret").tag(true)
5370 }
@@ -78,6 +95,9 @@ struct ExportSheet: View {
7895 Spacer()
7996 Button("Cancel") { dismiss() }.keyboardShortcut(.cancelAction)
8097 Button("Export") {
98 var settings = ExportSettings()
99 (settings.format, settings.subtree, settings.bodyOnly, settings.openAfter) = (format, subtree, bodyOnly, openAfter)
100 settings.save(for: source.path, lastUsed: true)
81101 #if APPSTORE
82102 export(format, destination, openAfter, subtree && inSubtree, bodyOnly && allowsBodyOnly)
83103 #else
Sources/OrgstarMobile/EditorScreen.swift +6 −1
@@ -486,6 +486,10 @@ struct EditorScreen: View {
486486 if let text = session.document(of: path)?.text { message = ExportMenu.copy(path: path, text: text, theme: model.theme) }
487487 } else if id == "app.export.html-open" {
488488 exportHTMLAndOpen()
489 } else if id == "app.export-body-only" {
490 let on = !ExportSettings.saved(for: path).bodyOnly
491 ExportMenu.setBodyOnly(on, path: path)
492 message = on ? "Export: body only" : "Export: whole document"
489493 } else if id == "app.export.icalendar-agenda" || id == "app.export.icalendar-combined" {
490494 agendaCalendars(combined: id == "app.export.icalendar-combined")
491495 } else if id.hasPrefix("app.publish") {
@@ -632,7 +636,7 @@ extension EditorScreen {
632636 /// `org-html-export-to-html` and open: the page in Quick Look, from a temporary file.
633637 private func exportHTMLAndOpen() {
634638 guard let text = session.document(of: path)?.text else { return }
635 let html = OrgExport.html(text, path: path, theme: model.theme)
639 let html = OrgExport.html(text, path: path, theme: model.theme, bodyOnly: ExportSettings.saved(for: path).bodyOnly)
636640 let name = ExportScope.output(for: URL(fileURLWithPath: path), name: ExportScope.fileName(text, settings: OrgPreferences.orgSettings()), extension: "html")
637641 .lastPathComponent
638642 do {
@@ -1090,6 +1094,7 @@ struct CommandPalette: View {
10901094 ("app.clock.default", "Mark as Default Clock Task"), ("app.clock.resolve", "Resolve Open Clocks…"),
10911095 ("app.refile", "Refile…"), ("app.refile.copy", "Copy to Refile Target…"), ("app.refile.goto", "Go to Refile Target…"),
10921096 ("app.archive", "Archive Subtree"), ("app.copy-rich-text", "Copy as Rich Text"), ("app.export.html-open", "Export to HTML and Open"),
1097 ("app.export-body-only", "Turn Body-Only Export On or Off"),
10931098 ("app.export.icalendar-agenda", "Export Agenda Files to iCalendar"), ("app.export.icalendar-combined", "Combine Agenda Files into iCalendar"),
10941099 ("app.publish", "Publish Project…"), ("app.publish.all", "Publish All Projects"), ("app.publish.current-file", "Publish Current File"),
10951100 ("app.publish.current-project", "Publish Current Project"),
Sources/OrgstarMobile/ExportMenu.swift +33 −10
@@ -31,6 +31,9 @@ struct OrgExport: Transferable {
3131 }
3232 }
3333
34 /// Whether it can leave out the title and the page around the text.
35 var allowsBodyOnly: Bool { [.html, .markdown, .latex, .ascii].contains(self) }
36
3437 var fileExtension: String {
3538 switch self {
3639 case .html: "html"
@@ -55,6 +58,8 @@ struct OrgExport: Transferable {
5558 let codeStyle: HTMLCodeStyle
5659 /// The subtree at this offset exported alone.
5760 var subtree: Int?
61 /// Without the title and the page around the text, in the formats that allow it.
62 var bodyOnly = false
5863
5964 /// The subtree's `EXPORT_FILE_NAME`, `#+EXPORT_FILE_NAME`'s name, or the file's, with the
6065 /// format's extension.
@@ -93,10 +98,10 @@ struct OrgExport: Transferable {
9398
9499 /// The page HTML export makes of `text`, the file at `path`, with its setup files.
95100 @MainActor
96 static func html(_ text: String, path: String, theme: ThemeSpec) -> String {
101 static func html(_ text: String, path: String, theme: ThemeSpec, bodyOnly: Bool = false) -> String {
97102 let base = ((path as NSString).lastPathComponent as NSString).deletingPathExtension
98103 let settings = OrgPreferences.orgSettings().resolvingSetupFiles(in: text, path: path, read: OrgSettings.readFile)
99 return HTMLExport.page(text, fallbackTitle: base, settings: settings, path: path,
104 return HTMLExport.page(text, fallbackTitle: base, settings: settings, path: path, bodyOnly: bodyOnly,
100105 codeStyle: HTMLCodeStyle(highlighter: MobileEditor.highlighter, theme: theme), language: OrgPreferences.exportLanguage())
101106 }
102107
@@ -109,14 +114,14 @@ struct OrgExport: Transferable {
109114 let text = subtree.flatMap { ExportScope.subtree(self.text, at: $0, settings: settings) } ?? self.text
110115 switch format {
111116 case .html:
112 try HTMLExport.page(text, fallbackTitle: base, settings: settings, path: path, codeStyle: codeStyle, language: OrgPreferences.exportLanguage())
117 try HTMLExport.page(text, fallbackTitle: base, settings: settings, path: path, bodyOnly: bodyOnly, codeStyle: codeStyle, language: OrgPreferences.exportLanguage())
113118 .write(to: url, atomically: true, encoding: .utf8)
114119 case .markdown:
115 try MarkdownExport.document(text, settings: settings, path: path).write(to: url, atomically: true, encoding: .utf8)
120 try MarkdownExport.document(text, settings: settings, path: path, bodyOnly: bodyOnly).write(to: url, atomically: true, encoding: .utf8)
116121 case .latex:
117122 let content: String
118123 do {
119 content = try LaTeXExport.document(text, settings: settings, path: path, language: OrgPreferences.exportLanguage(), file: true)
124 content = try LaTeXExport.document(text, settings: settings, path: path, bodyOnly: bodyOnly, language: OrgPreferences.exportLanguage(), file: true)
120125 } catch let error as LaTeXExport.Unsupported {
121126 let message = "Can't export to LaTeX: \(error.reason)"
122127 await MainActor.run { NotificationCenter.default.post(name: Self.refused, object: message) }
@@ -126,7 +131,7 @@ struct OrgExport: Transferable {
126131 case .ascii:
127132 let content: String
128133 do {
129 content = try ASCIIExport.document(text, settings: settings, path: path, language: OrgPreferences.exportLanguage(), file: true)
134 content = try ASCIIExport.document(text, settings: settings, path: path, bodyOnly: bodyOnly, language: OrgPreferences.exportLanguage(), file: true)
130135 } catch let error as ASCIIExport.Unsupported {
131136 let message = "Can't export to plain text: \(error.reason)"
132137 await MainActor.run { NotificationCenter.default.post(name: Self.refused, object: message) }
@@ -166,18 +171,24 @@ struct ExportMenu: View {
166171 var report: (String) -> Void = { _ in }
167172 /// Offers the subtree at the caret alone, where there is a caret.
168173 var exportSubtree: (() -> Void)?
174 /// Every file's export settings as kept, so the menu follows a change to this file's.
175 @AppStorage(ExportSettings.key) private var kept = Data()
169176
170177 var body: some View {
178 let bodyOnly = kept.isEmpty ? false : ExportSettings.saved(for: path).bodyOnly
171179 Menu("Export", systemImage: "square.and.arrow.up") {
172180 ForEach(OrgExport.Format.allCases, id: \.self) { format in
173181 if format.locked {
174182 Button("\(format.name) (orgstar+)") { ProAccess.shared.allows(.export) }
183 } else if bodyOnly, !format.allowsBodyOnly {
184 Button(format.name) { report(ExportSettings.noBodyOnly) }
175185 } else {
176186 let export = OrgExport(text: text, path: path, format: format, settings: OrgPreferences.orgSettings(),
177 codeStyle: HTMLCodeStyle(highlighter: MobileEditor.highlighter, theme: model.theme))
187 codeStyle: HTMLCodeStyle(highlighter: MobileEditor.highlighter, theme: model.theme), bodyOnly: bodyOnly)
178188 ShareLink(item: export, preview: SharePreview(export.fileName)) { Text(format.name) }
179189 }
180190 }
191 Toggle("Body Only", isOn: Binding(get: { bodyOnly }, set: { ExportMenu.setBodyOnly($0, path: path) }))
181192 if let exportSubtree {
182193 Button("Export Subtree…", systemImage: "list.bullet.indent") { exportSubtree() }
183194 }
@@ -197,6 +208,13 @@ struct ExportMenu: View {
197208 }
198209 }
199210
211 /// Keeps the body-only choice for the file at `path`.
212 static func setBodyOnly(_ on: Bool, path: String) {
213 var settings = ExportSettings.saved(for: path)
214 settings.bodyOnly = on
215 settings.save(for: path)
216 }
217
200218 /// The file on the clipboard as HTML, RTF and plain text, to paste formatted. Returns a message.
201219 @MainActor
202220 static func copy(path: String, text: String, theme: ThemeSpec) -> String {
@@ -263,10 +281,15 @@ struct SubtreeExportScreen: View {
263281
264282 var body: some View {
265283 NavigationStack {
284 let bodyOnly = ExportSettings.saved(for: path).bodyOnly
266285 List(OrgExport.Format.allCases.filter { !$0.locked }, id: \.self) { format in
267 let export = OrgExport(text: text, path: path, format: format, settings: OrgPreferences.orgSettings(),
268 codeStyle: HTMLCodeStyle(highlighter: MobileEditor.highlighter, theme: model.theme), subtree: caret)
269 ShareLink(item: export, preview: SharePreview(export.fileName)) { Text(format.name) }
286 if bodyOnly, !format.allowsBodyOnly {
287 LabeledContent(format.name) { Text("No body-only export") }.foregroundStyle(.secondary)
288 } else {
289 let export = OrgExport(text: text, path: path, format: format, settings: OrgPreferences.orgSettings(),
290 codeStyle: HTMLCodeStyle(highlighter: MobileEditor.highlighter, theme: model.theme), subtree: caret, bodyOnly: bodyOnly)
291 ShareLink(item: export, preview: SharePreview(export.fileName)) { Text(format.name) }
292 }
270293 }
271294 .navigationTitle("Export Subtree")
272295 .navigationBarTitleDisplayMode(.inline)
Sources/OrgstarMobile/MobileEditor.swift +1 −1
@@ -426,7 +426,7 @@ final class MobileEditor: NSObject, DocumentBuffer {
426426 case "app.crypt.open-entry", "app.crypt.decrypt-entry": return onAppCommand != nil && OrgCrypt.encryptedRange(context.text, at: context.caret) != nil
427427 case "app.table-export", "app.plot": return onAppCommand != nil && ImportTable.exportText(context.text, at: context.caret, path: "") != nil
428428 case "app.refile", "app.refile.copy", "app.archive": return onAppCommand != nil && Presentation.heading(containing: context.caret, in: context.tree) != nil
429 case "app.copy-rich-text", "app.export.html-open", "app.export.icalendar-agenda", "app.export.icalendar-combined": return onAppCommand != nil
429 case "app.copy-rich-text", "app.export.html-open", "app.export-body-only", "app.export.icalendar-agenda", "app.export.icalendar-combined": return onAppCommand != nil
430430 case _ where id.hasPrefix("app.publish"): return onAppCommand != nil
431431 case _ where Self.linkCommands.contains(id): return onAppCommand != nil
432432 case "org.link.open": return OpenLinkAtPoint().applies(in: context)
Tests/OrgAppTests/ExportSettingsTests.swift added +97
@@ -0,0 +1,97 @@
1import Foundation
2import Testing
3@testable import OrgApp
4import OrgCore
5
6struct ExportSettingsTests {
7 static func defaults() -> UserDefaults { UserDefaults(suiteName: "orgstar-export-\(UUID().uuidString)")! }
8
9 static let file = "#+TITLE: Whole\n#+OPTIONS: toc:nil\nIntro.\n* One\nFirst.\n** Sub\nSub body.\n* Two\nSecond.\n"
10 static var caret: Int { (file as NSString).range(of: "First.").location }
11
12 /// What the Mac's export writes for a format, scope and body-only choice.
13 static func export(_ format: String, subtree: Bool, bodyOnly: Bool) throws -> String {
14 let text = subtree ? try #require(ExportScope.subtree(file, at: caret)) : file
15 switch format {
16 case "markdown": return MarkdownExport.document(text, bodyOnly: bodyOnly)
17 case "latex": return try LaTeXExport.document(text, bodyOnly: bodyOnly, author: "A", file: true)
18 case "text": return try ASCIIExport.document(text, bodyOnly: bodyOnly, author: "A", file: true)
19 default: return HTMLExport.page(text, fallbackTitle: "t", bodyOnly: bodyOnly)
20 }
21 }
22
23 @Test func settingsAreKeptPerFile() {
24 let defaults = Self.defaults()
25 #expect(ExportSettings.saved(for: "/notes/a.org", defaults: defaults) == ExportSettings())
26 var a = ExportSettings()
27 (a.format, a.subtree, a.bodyOnly, a.openAfter) = ("markdown", true, true, true)
28 a.save(for: "/notes/a.org", defaults: defaults)
29 var b = ExportSettings()
30 b.format = "latex"
31 b.save(for: "/notes/b.org", defaults: defaults)
32 #expect(ExportSettings.saved(for: "/notes/a.org", defaults: defaults) == a)
33 #expect(ExportSettings.saved(for: "/notes/b.org", defaults: defaults) == b)
34 #expect(ExportSettings.saved(for: "/notes/c.org", defaults: defaults) == ExportSettings())
35 }
36
37 /// A file without settings starts with the format and open-after choice last exported
38 /// with, and exports the whole file as a whole document.
39 @Test func aFileWithoutSettingsGetsTheLastUsedFormat() {
40 let defaults = Self.defaults()
41 var a = ExportSettings()
42 (a.format, a.subtree, a.bodyOnly, a.openAfter) = ("markdown", true, true, true)
43 a.save(for: "/notes/a.org", lastUsed: true, defaults: defaults)
44 var fresh = ExportSettings()
45 (fresh.format, fresh.openAfter) = ("markdown", true)
46 #expect(ExportSettings.saved(for: "/notes/c.org", defaults: defaults) == fresh)
47 var b = ExportSettings()
48 b.format = "odt"
49 b.save(for: "/notes/b.org", defaults: defaults)
50 #expect(ExportSettings.saved(for: "/notes/c.org", defaults: defaults) == fresh)
51 }
52
53 /// A single-format command exports what the dialog does with the same scope and body-only
54 /// choice.
55 @Test(arguments: ["html", "html-open", "markdown", "latex", "text"])
56 func commandsFollowTheFilesSettings(_ format: String) throws {
57 let defaults = Self.defaults()
58 let whole = try Self.export(format, subtree: false, bodyOnly: false)
59 let fresh = try #require(ExportSettings.saved(for: "/notes/a.org", defaults: defaults).commandOptions(format))
60 #expect(try Self.export(format, subtree: fresh.subtree, bodyOnly: fresh.bodyOnly) == whole)
61 for (subtree, bodyOnly) in [(true, false), (false, true), (true, true)] {
62 var settings = ExportSettings()
63 (settings.subtree, settings.bodyOnly) = (subtree, bodyOnly)
64 settings.save(for: "/notes/a.org", defaults: defaults)
65 let options = try #require(ExportSettings.saved(for: "/notes/a.org", defaults: defaults).commandOptions(format))
66 let dialog = try Self.export(format, subtree: subtree, bodyOnly: bodyOnly)
67 #expect(try Self.export(format, subtree: options.subtree, bodyOnly: options.bodyOnly) == dialog)
68 #expect(dialog != whole)
69 #expect(dialog.contains("Second.") == !subtree)
70 }
71 }
72
73 @Test func theMessageSaysWhatWasExported() {
74 #expect(ExportSettings.exported("a.html", subtree: false, bodyOnly: false) == "Exported to a.html")
75 #expect(ExportSettings.exported("a.html", subtree: true, bodyOnly: false) == "Exported the subtree to a.html")
76 #expect(ExportSettings.exported("a.html", subtree: false, bodyOnly: true) == "Exported the body to a.html")
77 #expect(ExportSettings.exported("a.html", subtree: true, bodyOnly: true) == "Exported the subtree's body to a.html")
78 }
79
80 /// Body only is refused for the formats the dialog disables it for; the agenda files'
81 /// calendars follow neither choice.
82 @Test func bodyOnlyIsRefusedForWholeDocumentFormats() throws {
83 var settings = ExportSettings()
84 (settings.subtree, settings.bodyOnly) = (true, true)
85 for format in ["pdf", "print-pdf", "odt", "docx", "rtf", "plain-text", "icalendar"] {
86 #expect(!ExportSettings.allowsBodyOnly(format))
87 #expect(settings.commandOptions(format) == nil)
88 }
89 for format in ["icalendar-agenda", "icalendar-combined"] {
90 let options = try #require(settings.commandOptions(format))
91 #expect(options == (false, false))
92 }
93 settings.bodyOnly = false
94 let options = try #require(settings.commandOptions("print-pdf"))
95 #expect(options == (true, false))
96 }
97}
Tests/OrgCoreTests/ExportScopeTests.swift +46
@@ -68,6 +68,52 @@ struct ExportScopeTests {
6868 #expect(ExportScope.output(for: source, name: nil, extension: "md").path == "/notes/t.md")
6969 }
7070
71 /// The words `C-s` and `C-b` keep in ox-html and ox-md, for the whole file and a subtree.
72 @Test(.enabled(if: ProcessInfo.processInfo.environment["ORGSTAR_SKIP_ORACLE"] == nil))
73 func subtreeAndBodyOnlyKeepWhatOrgKeeps() throws {
74 let text = """
75 #+TITLE: wordtitle
76 #+AUTHOR: wordauthor
77 #+OPTIONS: toc:nil num:nil
78 wordintro
79 * wordone
80 SCHEDULED: <2026-10-10 Sat>
81 :PROPERTIES:
82 :EXPORT_AUTHOR: wordbob
83 :wordkey: wordvalue
84 :END:
85 wordfirst
86 ** wordsub
87 worddeep
88 * wordtwo
89 wordsecond
90 """ + "\n"
91 let offset = (text as NSString).range(of: "wordfirst").location
92 let point = EmacsOracle.point(offset, in: text)
93 let emacs = try EmacsOracle.evaluate(text, """
94 (progn
95 (require 'ox-html) (require 'ox-md)
96 (goto-char \(point))
97 (list (org-export-as 'html t nil nil) (org-export-as 'html nil nil t) (org-export-as 'html t nil t)
98 (org-export-as 'md t nil nil) (org-export-as 'md nil nil t) (org-export-as 'md t nil t)))
99 """)
100 let subtree = try #require(ExportScope.subtree(text, at: offset))
101 let ours = [
102 HTMLExport.page(subtree, fallbackTitle: "t"), HTMLExport.page(text, fallbackTitle: "t", bodyOnly: true),
103 HTMLExport.page(subtree, fallbackTitle: "t", bodyOnly: true),
104 MarkdownExport.document(subtree), MarkdownExport.document(text, bodyOnly: true), MarkdownExport.document(subtree, bodyOnly: true),
105 ]
106 let names = ["html subtree", "html body", "html subtree body", "md subtree", "md body", "md subtree body"]
107 let words = Set(text.matches(of: /\bword[a-z]+\b/).map { String($0.0) })
108 for (index, name) in names.enumerated() {
109 // ox-md writes no title; this export makes it the top heading.
110 for word in words where !(name == "md subtree" && word == "wordone") {
111 #expect(ours[index].contains(word) == emacs[index].contains(word), "\(name) \(word)\nours:\n\(ours[index])\nemacs:\n\(emacs[index])")
112 }
113 }
114 #expect(emacs[0].contains("wordone") && !emacs[2].contains("wordone") && !emacs[1].contains("wordtitle") && emacs[1].contains("wordsecond"))
115 }
116
71117 @Test func markdownBodyOnlyHasNoTitle() {
72118 let text = "#+TITLE: T\n* A\nx\n"
73119 #expect(MarkdownExport.document(text).hasPrefix("# T"))
docs/manual/guide/03-keys.org +2
@@ -985,6 +985,8 @@ When a key appears in several rows, it runs the command whose condition holds at
985985| Command | Emacs | Mac | Doom | What it does |
986986|-+-+-+-+-|
987987| Export… (=app.export-dialog=) | — | =⇧⌘E= | — | Opens the export sheet. In the Emacs and Doom presets =C-c C-e= is a prefix for the export keys only; pausing after it lists them in the key hints. |
988| Turn Subtree Export On or Off (=app.export-subtree=) | =C-c C-e C-s= | — | — | The file's export commands export the subtree at the caret, or the whole file again (=C-s= in =org-export-dispatch=). |
989| Turn Body-Only Export On or Off (=app.export-body-only=) | =C-c C-e C-b= | — | — | The file's export commands leave out the title and the page, or write them again (=C-b= in =org-export-dispatch=). |
988990| Export to HTML (=app.export.html=) | =C-c C-e h h= | — | =SPC m e h h= (N) | Exports to HTML (=org-html-export-to-html=). |
989991| Export to HTML and Open (=app.export.html-open=) | =C-c C-e h o= | — | =SPC m e h o= (N) | Exports to HTML and opens the result. |
990992| Export to Markdown (=app.export.markdown=) | =C-c C-e m m= | — | =SPC m e m m= (N) | Exports to Markdown (=org-md-export-to-markdown=). |
docs/manual/guide/12-export.org +15 −5
@@ -27,7 +27,16 @@ Export works on the file in the current editor, using its text as it is now, sav
2727
2828The keys follow Emacs's export dispatcher (=org-export-dispatch=). =C-c C-e= on its own is only a prefix: pause after it and the key hints list the formats. The =SPC m e= keys work in normal state; the =C-c C-e= keys work in every Doom state. The Mac preset has no keys for the single formats; its =⇧⌘E= opens the export dialog.
2929
30All fourteen commands are in File ▸ Export and in the command palette. They write the export beside the Org file, with the same name and the format's extension: =.html=, =.md=, =.pdf=, =.docx=, =.rtf=, =.tex=, =.odt=, =.txt= or =.ics=. The two agenda-file commands are the exceptions; see [[*iCalendar export][iCalendar export]]. =#+EXPORT_FILE_NAME:= names it instead, as in Org: relative to the Org file's folder (or absolute, or starting with =~=), with its extension replaced by the format's, so =#+EXPORT_FILE_NAME: out/report= writes =out/report.html=. A file already there is replaced. The message area shows "Exported to /name/".
30All fourteen commands are in File ▸ Export and in the command palette. They write the export beside the Org file, with the same name and the format's extension: =.html=, =.md=, =.pdf=, =.docx=, =.rtf=, =.tex=, =.odt=, =.txt= or =.ics=. The two agenda-file commands are the exceptions; see [[*iCalendar export][iCalendar export]]. =#+EXPORT_FILE_NAME:= names it instead, as in Org: relative to the Org file's folder (or absolute, or starting with =~=), with its extension replaced by the format's, so =#+EXPORT_FILE_NAME: out/report= writes =out/report.html=. A file already there is replaced. The message area shows "Exported to /name/", or "Exported the subtree to /name/", "Exported the body to /name/" or "Exported the subtree's body to /name/" when the export was not the whole file as a whole document.
31
32The twelve commands that export the current file export the whole file as a whole document, unless the file is set otherwise. Two commands set it, as =C-s= and =C-b= do in Org's dispatcher:
33
34| Command | Emacs preset and Doom | Effect on the file's export commands |
35|---------------------------------+-----------------------+-------------------------------------------------------------------|
36| Turn Subtree Export On or Off | =C-c C-e C-s= | They export the subtree at the caret; see /Scope/ below. |
37| Turn Body-Only Export On or Off | =C-c C-e C-b= | They leave out the title and the page; see /Body only/ below. |
38
39Both are in the command palette, and the message area says what is now on. The choice is kept for the file, and it is the same one the export dialog shows as /Scope/ and /Body only/, so setting it in the dialog sets it for the commands too. With subtree export on and the caret before the first heading, a command says "Not in a subtree" and writes nothing. With body-only export on, a command for PDF, Word, RTF, plain text, ODT or iCalendar says "This format has no body-only export. Turn body-only export off for this file first." and writes nothing. The two agenda-file commands follow neither.
3140
3241The [[file:../install.org][Mac App Store version]] has the thirteen commands that don't need Emacs; File ▸ Export, the export dialog and the command palette leave out Export to PDF with Emacs, and a key bound to it runs Export to PDF. When the export file, or an =#+INCLUDE:= or =#+SETUPFILE:=, is outside your folders, orgstar first asks for access to its folder; for the export file, Save Elsewhere… instead picks another place. See [[file:../install.org][Install]].
3342
@@ -42,13 +51,15 @@ The [[file:../install.org][Mac App Store version]] has the thirteen commands tha
4251- *Margins*, *Font* and *Page numbers*, for PDF: see /PDF export/.
4352- *Open after export*: opens the file in its default app when the export finishes.
4453
45The dialog remembers the format and the *Open after export* setting. The PDF settings are =config.toml= settings, and apply to every PDF export.
54The dialog keeps the format, scope, body-only and *Open after export* settings for each file, by the file's path, in orgstar's preferences; nothing is written to the Org file, and a renamed or moved file starts again. They are saved when you click Export. A file exported for the first time starts with the format and *Open after export* setting last used, the whole file, and body only off. When the kept scope is the subtree and the caret is before the first heading, the dialog exports the whole file. The destination is not kept. The PDF settings are =config.toml= settings, and apply to every PDF export.
4655
4756** On iOS
4857
4958The Export menu offers HTML, Markdown, PDF, Word, Rich Text (RTF), Plain Text, ODT, iCalendar, LaTeX and Plain Text (ASCII), and Copy as Rich Text. It is under More in the editor, and in the toolbar in the reader. Choosing one opens the share sheet with the exported file, named after the Org file or its =#+EXPORT_FILE_NAME:=. Send it to another app, or use Save to Files to keep it. The export is the same as on the Mac, except that LaTeX, ODT and ASCII have no author unless the file has =#+AUTHOR:=. PDF through LaTeX is not available on iOS.
5059
51The Export menu also has Export Agenda Files to iCalendar and Combine Agenda Files into iCalendar (see [[*iCalendar export][iCalendar export]]). Export to HTML and Open, in Commands or on =C-c C-e h o= with a hardware keyboard, shows the HTML export in Quick Look, with the file's images in the page; nothing is written beside the Org file. Copy as Rich Text is in Commands too.
60Body Only in the Export menu leaves out the title and the page around the text, as in the Mac's export dialog, and is kept for each file. While it is on, PDF, Word, Rich Text (RTF), Plain Text, ODT and iCalendar say "This format has no body-only export. Turn body-only export off for this file first." Turn Body-Only Export On or Off, in Commands or on =C-c C-e C-b= with a hardware keyboard, changes the same setting. Export Subtree…, in the editor's Export menu, lists the formats for the subtree at the caret, and follows Body Only too. There is no subtree setting on iOS: the menu's formats always export the whole file.
61
62The Export menu also has Export Agenda Files to iCalendar and Combine Agenda Files into iCalendar (see [[*iCalendar export][iCalendar export]]). Export to HTML and Open, in Commands or on =C-c C-e h o= with a hardware keyboard, shows the HTML export in Quick Look, with the file's images in the page; nothing is written beside the Org file; it follows Body Only. Copy as Rich Text is in Commands too.
5263
5364* HTML export
5465
@@ -466,6 +477,5 @@ The publisher part comes from the =publisher=, =journal=, =institution= or =scho
466477
467478* What export does not do
468479
469- Subtree and body-only export are in the export dialog only; the single-format commands export the whole file. There is no asynchronous export.
480- There is no asynchronous export.
470481- Source blocks are not run, and noweb references are not expanded.
471- Export settings in the dialog are not per file.
docs/manual/guide/14-ios.org +2
@@ -335,6 +335,8 @@ Export (in the reader's toolbar and the editor's More menu) offers HTML, Markdow
335335
336336PDF export follows =pdf-margin=, =pdf-font= and =pdf-page-numbers= in =config.toml=, and Word files get heading styles and the file's images, as on the Mac. PDF through LaTeX isn't available on iOS.
337337
338Body Only in the Export menu leaves out the title and the page around the text in HTML, Markdown, LaTeX and Plain Text (ASCII), and is kept for each file; the other formats say they have no body-only export while it is on. Export Subtree…, in the editor's Export menu, shares the subtree at the caret in any of the formats.
339
338340The Export menu also has Export Agenda Files to iCalendar, which writes an =.ics= beside each agenda file, and Combine Agenda Files into iCalendar, which shares one calendar of them all. Commands has these, Copy as Rich Text, and Export to HTML and Open, which shows the HTML export in Quick Look.
339341
340342Publishing works from Commands as on the Mac, with the =[[publish]]= projects in =config.toml=. A project that publishes outside your folders asks for a folder the first time, and uses it from then on. See [[file:12-export.org][Export]].
l10n/Localizable.xcstrings +138
@@ -4861,6 +4861,40 @@
48614861 }
48624862 }
48634863 },
4864 "Body Only": {
4865 "localizations": {
4866 "de": {
4867 "stringUnit": {
4868 "state": "translated",
4869 "value": "Nur Inhalt"
4870 }
4871 },
4872 "es": {
4873 "stringUnit": {
4874 "state": "translated",
4875 "value": "Solo el cuerpo"
4876 }
4877 },
4878 "fr": {
4879 "stringUnit": {
4880 "state": "translated",
4881 "value": "Corps uniquement"
4882 }
4883 },
4884 "ja": {
4885 "stringUnit": {
4886 "state": "translated",
4887 "value": "本文のみ"
4888 }
4889 },
4890 "pt-BR": {
4891 "stringUnit": {
4892 "state": "translated",
4893 "value": "Só o Corpo"
4894 }
4895 }
4896 }
4897 },
48644898 "Body only": {
48654899 "localizations": {
48664900 "de": {
@@ -20864,6 +20898,40 @@
2086420898 }
2086520899 }
2086620900 },
20901 "No body-only export": {
20902 "localizations": {
20903 "de": {
20904 "stringUnit": {
20905 "state": "translated",
20906 "value": "Kein Export nur des Inhalts"
20907 }
20908 },
20909 "es": {
20910 "stringUnit": {
20911 "state": "translated",
20912 "value": "Sin exportación solo del cuerpo"
20913 }
20914 },
20915 "fr": {
20916 "stringUnit": {
20917 "state": "translated",
20918 "value": "Pas d'exportation du corps uniquement"
20919 }
20920 },
20921 "ja": {
20922 "stringUnit": {
20923 "state": "translated",
20924 "value": "本文のみの書き出しなし"
20925 }
20926 },
20927 "pt-BR": {
20928 "stringUnit": {
20929 "state": "translated",
20930 "value": "Sem exportação só do corpo"
20931 }
20932 }
20933 }
20934 },
2086720935 "No buffer": {
2086820936 "localizations": {
2086920937 "de": {
@@ -34029,6 +34097,76 @@
3402934097 }
3403034098 }
3403134099 },
34100 "Turn Body-Only Export On or Off": {
34101 "comment": "Command title",
34102 "localizations": {
34103 "de": {
34104 "stringUnit": {
34105 "state": "translated",
34106 "value": "Export nur des Inhalts ein- oder ausschalten"
34107 }
34108 },
34109 "es": {
34110 "stringUnit": {
34111 "state": "translated",
34112 "value": "Activar o desactivar la exportación solo del cuerpo"
34113 }
34114 },
34115 "fr": {
34116 "stringUnit": {
34117 "state": "translated",
34118 "value": "Activer ou désactiver l'exportation du corps uniquement"
34119 }
34120 },
34121 "ja": {
34122 "stringUnit": {
34123 "state": "translated",
34124 "value": "本文のみの書き出しのオン/オフ"
34125 }
34126 },
34127 "pt-BR": {
34128 "stringUnit": {
34129 "state": "translated",
34130 "value": "Ativar ou Desativar Exportação Só do Corpo"
34131 }
34132 }
34133 }
34134 },
34135 "Turn Subtree Export On or Off": {
34136 "comment": "Command title",
34137 "localizations": {
34138 "de": {
34139 "stringUnit": {
34140 "state": "translated",
34141 "value": "Teilbaum-Export ein- oder ausschalten"
34142 }
34143 },
34144 "es": {
34145 "stringUnit": {
34146 "state": "translated",
34147 "value": "Activar o desactivar la exportación del subárbol"
34148 }
34149 },
34150 "fr": {
34151 "stringUnit": {
34152 "state": "translated",
34153 "value": "Activer ou désactiver l'exportation du sous-arbre"
34154 }
34155 },
34156 "ja": {
34157 "stringUnit": {
34158 "state": "translated",
34159 "value": "サブツリー書き出しのオン/オフ"
34160 }
34161 },
34162 "pt-BR": {
34163 "stringUnit": {
34164 "state": "translated",
34165 "value": "Ativar ou Desativar Exportação da Subárvore"
34166 }
34167 }
34168 }
34169 },
3403234170 "Turn on Badges in orgstar's notification settings.": {
3403334171 "localizations": {
3403434172 "de": {