Commit c4d5cb219a
Verified · cmc
Changed files (5)
Sources/OrgApp/CommandRanking.swift +1 −1 · view
| @@ -84,7 +84,7 @@ public enum CommandGroups { | ||
| 84 | 84 | Group(title: String(localized: "Tables", comment: "Org menu submenu"), prefixes: ["org.table", "app.table-", "app.plot"]), |
| 85 | 85 | Group(title: String(localized: "Links and Footnotes", comment: "Org menu submenu"), prefixes: ["org.link.", "org.id.", "org.footnote."]), |
| 86 | 86 | Group(title: String(localized: "Blocks", comment: "Org menu submenu"), prefixes: ["org.babel.", "org.structure-template", "org.edit-special", "org.dblock.", "org.clock.report", "org.denote."]), |
| 87 | Group(title: String(localized: "Text", comment: "Org menu submenu"), prefixes: ["org.emphasize", "org.fill-"]), | |
| 87 | Group(title: String(localized: "Text", comment: "Org menu submenu"), prefixes: ["org.emphasize", "org.fill-", "org.snippet"]), | |
| 88 | 88 | Group(title: String(localized: "Attachments", comment: "Org menu submenu"), prefixes: ["app.attach."]), |
| 89 | 89 | Group(title: String(localized: "Notes", comment: "Org menu submenu"), prefixes: ["app.dailies.", "app.node.", "app.backlinks"]), |
| 90 | 90 | Group(title: String(localized: "Encryption", comment: "Org menu submenu"), prefixes: ["app.crypt."]), |
Sources/OrgstarMobile/EditorScreen.swift +3 −2 · view
| @@ -443,12 +443,12 @@ struct EditorScreen: View { | ||
| 443 | 443 | } else if id == "app.archive" { |
| 444 | 444 | if let caret = self.editor?.editContext().caret { message = session.archive(from: (path, caret)) } |
| 445 | 445 | } else if id == "app.copy-rich-text" { |
| 446 | if let text = session.document(of: path)?.text { message = ExportMenu.copy(path: path, text: text, theme: model.theme) } | |
| 446 | if let text = session.document(of: path)?.text { message = ExportItems.copy(path: path, text: text, theme: model.theme) } | |
| 447 | 447 | } else if id == "app.export.html-open" { |
| 448 | 448 | exportHTMLAndOpen() |
| 449 | 449 | } else if id == "app.export-body-only" { |
| 450 | 450 | let on = !ExportSettings.saved(for: path).bodyOnly |
| 451 | ExportMenu.setBodyOnly(on, path: path) | |
| 451 | ExportItems.setBodyOnly(on, path: path) | |
| 452 | 452 | message = on ? "Export: body only" : "Export: whole document" |
| 453 | 453 | } else if id == "app.export.icalendar-agenda" || id == "app.export.icalendar-combined" { |
| 454 | 454 | agendaCalendars(combined: id == "app.export.icalendar-combined") |
| @@ -1174,6 +1174,7 @@ struct CommandPalette: View { | ||
| 1174 | 1174 | ("app.publish", "Publish Project…"), ("app.publish.all", "Publish All Projects"), ("app.publish.current-file", "Publish Current File"), |
| 1175 | 1175 | ("app.publish.current-project", "Publish Current Project"), |
| 1176 | 1176 | ("app.toggle-markup", "Show or Hide Markup"), ("app.word-count", "Word Count"), |
| 1177 | ("org.snippet.next-field", "Next Snippet Field"), ("org.snippet.previous-field", "Previous Snippet Field"), | |
| 1177 | 1178 | ("app.recovery", "Recovery Versions…"), ("app.sync-conflicts", "Resolve Sync Conflicts…"), |
| 1178 | 1179 | ("org.toggle-inline-images", "Show or Hide Inline Images"), ("org.toggle-inline-images-linked", "Show or Hide Inline Images, Including Described Links"), ("org.latex-preview", "Show or Hide LaTeX Previews"), ("editor.toggle-truncate-lines", "Truncate or Wrap Long Lines"), ("editor.toggle-auto-fill", "Turn Auto Fill On or Off"), |
| 1179 | 1180 | ("edit.isearch-forward", "Incremental Search"), ("edit.isearch-backward", "Incremental Search Backward"), |
Sources/OrgstarMobile/ExportMenu.swift +33 −2 · view
| @@ -163,6 +163,37 @@ struct OrgExport: Transferable { | ||
| 163 | 163 | /// Sharing the file as HTML, Markdown, PDF, Word, RTF, plain text, ODT, iCalendar, LaTeX or ASCII: to another app, or saved with |
| 164 | 164 | /// Save to Files; or copying it as rich text. |
| 165 | 165 | struct ExportMenu: View { |
| 166 | let path: String | |
| 167 | let tree: OrgTree | |
| 168 | var report: (String) -> Void = { _ in } | |
| 169 | var exportSubtree: (() -> Void)? | |
| 170 | ||
| 171 | var body: some View { | |
| 172 | Menu("Export", systemImage: "square.and.arrow.up") { | |
| 173 | ExportItems(path: path, tree: tree, report: report, exportSubtree: exportSubtree) | |
| 174 | } | |
| 175 | } | |
| 176 | } | |
| 177 | ||
| 178 | /// The export menu's items as a list, for a screen without the menu in its toolbar. | |
| 179 | struct ExportScreen: View { | |
| 180 | let path: String | |
| 181 | let tree: OrgTree | |
| 182 | var report: (String) -> Void = { _ in } | |
| 183 | @Environment(\.dismiss) private var dismiss | |
| 184 | ||
| 185 | var body: some View { | |
| 186 | NavigationStack { | |
| 187 | List { ExportItems(path: path, tree: tree, report: report) } | |
| 188 | .navigationTitle("Export") | |
| 189 | .navigationBarTitleDisplayMode(.inline) | |
| 190 | .toolbar { ToolbarItem(placement: .confirmationAction) { Button("Done") { dismiss() } } } | |
| 191 | } | |
| 192 | } | |
| 193 | } | |
| 194 | ||
| 195 | /// Export's formats, Body Only, the agenda calendars and Copy as Rich Text. | |
| 196 | struct ExportItems: View { | |
| 166 | 197 | let path: String |
| 167 | 198 | let tree: OrgTree |
| 168 | 199 | @Environment(MobileModel.self) private var model |
| @@ -178,7 +209,7 @@ struct ExportMenu: View { | ||
| 178 | 209 | let text = tree.text |
| 179 | 210 | // From the open tree: SwiftUI evaluates the menu on every edit. |
| 180 | 211 | let name = ExportScope.fileName(tree, settings: OrgPreferences.orgSettings()) |
| 181 | Menu("Export", systemImage: "square.and.arrow.up") { | |
| 212 | Group { | |
| 182 | 213 | ForEach(OrgExport.Format.allCases, id: \.self) { format in |
| 183 | 214 | if format.locked { |
| 184 | 215 | Button("\(format.name) (orgstar+)") { ProAccess.shared.allows(.export) } |
| @@ -190,7 +221,7 @@ struct ExportMenu: View { | ||
| 190 | 221 | ShareLink(item: export, preview: SharePreview(export.fileName)) { Text(format.name) } |
| 191 | 222 | } |
| 192 | 223 | } |
| 193 | Toggle("Body Only", isOn: Binding(get: { bodyOnly }, set: { ExportMenu.setBodyOnly($0, path: path) })) | |
| 224 | Toggle("Body Only", isOn: Binding(get: { bodyOnly }, set: { ExportItems.setBodyOnly($0, path: path) })) | |
| 194 | 225 | if let exportSubtree { |
| 195 | 226 | Button("Export Subtree…", systemImage: "list.bullet.indent") { exportSubtree() } |
| 196 | 227 | } |
Sources/OrgstarMobile/ReaderScreen.swift +6 −2 · view
| @@ -41,6 +41,7 @@ struct ReaderScreen: View { | ||
| 41 | 41 | @State private var width: CGFloat = 0 |
| 42 | 42 | @State private var showingOutline = false |
| 43 | 43 | @State private var showingCommands = false |
| 44 | @State private var showingExport = false | |
| 44 | 45 | /// The command chosen in Commands, run once the list is gone. |
| 45 | 46 | @State private var chosenCommand: String? |
| 46 | 47 | @State private var message: String? |
| @@ -129,9 +130,7 @@ struct ReaderScreen: View { | ||
| 129 | 130 | findRequest += 1 |
| 130 | 131 | } |
| 131 | 132 | .disabled(document == nil) |
| 132 | Button("Outline", systemImage: "list.bullet.indent") { showingOutline = true }.disabled(outline.isEmpty) | |
| 133 | 133 | if let path = shownPath { |
| 134 | if let tree = document?.tree { ExportMenu(path: path, tree: tree) { message = $0 } } | |
| 135 | 134 | NavigationLink(value: EditorRoute(path: path, offset: nil)) { Label("Edit", systemImage: "pencil") } |
| 136 | 135 | } |
| 137 | 136 | Button("Commands", systemImage: "command") { showingCommands = true } |
| @@ -148,6 +147,9 @@ struct ReaderScreen: View { | ||
| 148 | 147 | } |
| 149 | 148 | .quickLookPreview($previewed) |
| 150 | 149 | .sheet(isPresented: $showingOutline) { outlineSheet } |
| 150 | .sheet(isPresented: $showingExport) { | |
| 151 | if let path = shownPath, let tree = document?.tree { ExportScreen(path: path, tree: tree) { message = $0 } } | |
| 152 | } | |
| 151 | 153 | .message($message) |
| 152 | 154 | .environment(\.openURL, OpenURLAction { url in follow(url) }) |
| 153 | 155 | .background { FindHost(find: find, request: findRequest) } |
| @@ -165,6 +167,7 @@ struct ReaderScreen: View { | ||
| 165 | 167 | [ |
| 166 | 168 | CommandRow(id: "reader.find", title: String(localized: "Find"), reason: document == nil ? String(localized: "Nothing to do here") : nil), |
| 167 | 169 | CommandRow(id: "reader.outline", title: String(localized: "Outline"), reason: outline.isEmpty ? String(localized: "Nothing to do here") : nil), |
| 170 | CommandRow(id: "reader.export", title: String(localized: "Export…"), reason: document == nil ? String(localized: "Nothing to do here") : nil), | |
| 168 | 171 | CommandRow(id: "app.toggle-markup", title: CommandTitle.localized("Show or Hide Markup")), |
| 169 | 172 | CommandRow(id: "app.capture", title: CommandTitle.localized("Capture…")), |
| 170 | 173 | ] + MobileClock.screenCommands.map { CommandRow(id: $0.id, title: CommandTitle.localized($0.title)) } |
| @@ -176,6 +179,7 @@ struct ReaderScreen: View { | ||
| 176 | 179 | find.text = (document?.tree.text ?? "") as NSString |
| 177 | 180 | findRequest += 1 |
| 178 | 181 | case "reader.outline": showingOutline = true |
| 182 | case "reader.export": showingExport = true | |
| 179 | 183 | case "app.toggle-markup": model.showMarkup.toggle() |
| 180 | 184 | case "app.capture": model.captureRequest = CaptureRequest() |
| 181 | 185 | default: _ = MobileClock.run(id, model: model, workspace: workspace) { message = $0 } |
docs/manual/guide/14-ios.org +4 −4 · view
| @@ -42,7 +42,7 @@ Tap a file in Folders or Search, or Open in File in an agenda entry's sheet, to | ||
| 42 | 42 | - Text is styled as in the editor, in the theme's colours, font, size, line spacing and heading sizes, on the theme's background: TODO keywords, priorities, tags, emphasis, code, timestamps, links, and the code in src blocks. Text can be selected and copied. |
| 43 | 43 | - The reader follows the editor's display settings (see Themes and display below): Show Markup, hidden emphasis markers, pretty entities, indentation, leading stars, inline images and truncated lines. Tables show at full width, without narrowed columns. |
| 44 | 44 | - Tap a link to follow it. Links to headings and files in your folders open in the reader; links to other files, such as an attached PDF or image, open in Quick Look; web links open in the browser. |
| 45 | - The toolbar has Find, Outline (a list of headings to jump to), Export, Edit (the pencil) and Commands: Find, Outline, Show or Hide Markup, Capture… and the clock commands that need no caret. | |
| 45 | - The toolbar has Find, Edit (the pencil) and Commands, which has Outline (a list of headings to jump to) and Export… as well; see Commands below. | |
| 46 | 46 | - Tags aligned with spaces show at the right edge of the heading's line, or on a line of their own at the right when the heading wraps (see [[file:02-the-editor.org][The editor]], Wrapping and filling). |
| 47 | 47 | - Find opens the system find bar over the file's text. Results are marked, and the one shown is unfolded and scrolled to. |
| 48 | 48 | |
| @@ -156,9 +156,9 @@ Bold, Italic and Code are in the edit menu of a selection, under Format: each pu | ||
| 156 | 156 | |
| 157 | 157 | Commands, in the key bar and in the toolbar of the editor, the reader and the agenda, lists the commands of the screen. With nothing typed, the ten you ran from Commands most recently come first under Recent, then every command by subject, in the Org menu's groups (Visibility, Headings, TODO and Tags, and so on) followed by Clock, Export, File, Edit and View. Type to search: the letters you type must appear in the title in order, as in the Mac's command palette, and commands you run often rank a little higher. The command runs once the list closes. |
| 158 | 158 | |
| 159 | Named keyboard macros are listed by name under Edit. In the editor, a command that doesn't apply at the caret is listed greyed, with the reason, such as =Not in a list= or =No table at point=, so a search finds everything the editor can do. With a hardware keyboard attached, each command shows its Emacs key. | |
| 159 | Named keyboard macros are listed by name under Edit, and Next Snippet Field and Previous Snippet Field under Text with the other snippet commands. In the editor, a command that doesn't apply at the caret is listed greyed, with the reason, such as =Not in a list= or =No table at point=, so a search finds everything the editor can do. With a hardware keyboard attached, each command shows its Emacs key. | |
| 160 | 160 | |
| 161 | The reader's list has Find, Outline, Show or Hide Markup, Capture… and the clock commands that need no caret. The agenda's has its views, Tags and Properties…, Search…, Save as View…, Today, Earlier, Later, Go to Date…, Log Mode, Filter…, Select, Board, Capture… and the same clock commands. | |
| 161 | The reader's list has Find, Outline, Export…, Show or Hide Markup, Capture… and the clock commands that need no caret. The agenda's has its views, Tags and Properties…, Search…, Save as View…, Today, Earlier, Later, Go to Date…, Log Mode, Filter…, Select, Board, Capture… and the same clock commands. | |
| 162 | 162 | |
| 163 | 163 | When a command asks a question, a sheet opens: |
| 164 | 164 | |
| @@ -375,7 +375,7 @@ The app icon's badge counts the entries in the agenda's Overdue section that are | ||
| 375 | 375 | |
| 376 | 376 | * Export |
| 377 | 377 | |
| 378 | Export (in the reader's and the editor's toolbars) offers HTML, Markdown, PDF, Word, Rich Text (RTF), Plain Text, ODT, iCalendar, LaTeX and Plain Text (ASCII), and Copy as Rich Text. Each opens the share sheet with a file named after the org file, which you can send to another app or keep with Save to Files. The export reads the file's setup files and follows its export keywords, as the Mac's export does. For a file the LaTeX or ASCII export can't write as Emacs would, the share sheet stops and "Can't export to LaTeX: " or "Can't export to plain text: " and the reason show at the bottom of the screen. | |
| 378 | Export (in the editor's toolbar, and Export… in the reader's Commands) offers HTML, Markdown, PDF, Word, Rich Text (RTF), Plain Text, ODT, iCalendar, LaTeX and Plain Text (ASCII), and Copy as Rich Text. Each opens the share sheet with a file named after the org file, which you can send to another app or keep with Save to Files. The export reads the file's setup files and follows its export keywords, as the Mac's export does. For a file the LaTeX or ASCII export can't write as Emacs would, the share sheet stops and "Can't export to LaTeX: " or "Can't export to plain text: " and the reason show at the bottom of the screen. | |
| 379 | 379 | |
| 380 | 380 | PDF 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. |
| 381 | 381 | |