Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Leafdown uses lightweight [Keep a Changelog](https://keepachangelog.com/en/1.1.0

### Added

- Open several documents in one window as tabs. Opening a file, a recent file, an article in the navigator, a link, a search result, or a drop adds a tab after the one you are on, or switches to the tab already holding that file, so opening no longer replaces your document or asks about its unsaved changes. Each tab keeps its own unsaved edits, undo history, place in the document, and search. Switch with a click, `Ctrl+Tab` and `Ctrl+Shift+Tab`, `Ctrl+PageDown` and `Ctrl+PageUp`, or `Ctrl+1` to `Ctrl+9`; close one with `Ctrl+W`, its close button, or a middle click. Closing the window or the folder asks once about every tab with unsaved changes, Find in folder and Replace in folder include the unsaved text of every open tab, and the window's title in the taskbar names the active document.
- Give Markdown files associated with Leafdown a dedicated folded-page icon with the green leaf and Markdown symbol, separate from the application icon. Both Windows installers include it without changing your default app.
- List a folder's other files, such as images and PDFs, in the article navigator, so a folder holding only those no longer looks empty. They are dimmed, hovering one says that Leafdown can only open Markdown files, and choosing one does nothing; its context menu can still reveal it in File Explorer or copy its path. The article count, the filter, Find in folder, and wiki link suggestions still cover Markdown files only.

Expand Down
38 changes: 20 additions & 18 deletions docs/architecture.md

Large diffs are not rendered by default.

22 changes: 14 additions & 8 deletions docs/help/file-and-folder-workflows.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
# File and folder workflows

Leafdown keeps the open document and the folder context separate. The folder context pins the article navigator to one folder until you open or close another folder.
Leafdown keeps your open documents and the folder context separate. The folder context pins the article navigator to one folder until you open or close another folder.

## Open and revisit

**File > Open** opens one Markdown file: `.md`, `.markdown`, `.mdown`, or `.mkd`. If no folder is open, Leafdown also opens its parent folder as context. If a folder is already pinned, opening a file elsewhere leaves that context in place. **File > Open folder** scans the folder for Markdown articles and opens a matching root-level `readme` or `index` file when present. Ignored directories do not appear in the navigator.
**File > Open** opens one Markdown file: `.md`, `.markdown`, `.mdown`, or `.mkd`. If no folder is open, Leafdown also opens its parent folder as context. If a folder is already pinned, opening a file elsewhere leaves that context in place. **File > Open folder** scans the folder for Markdown articles and opens a matching root-level `readme` or `index` file when present, keeping the documents you already have open. Ignored directories do not appear in the navigator.

Opening another document starts it at the top. Following a heading link or choosing a search result instead brings its target into view.
## Work with tabs

Every document you open gets a tab above the document, after the one you are on, and **File > New** adds an untitled tab. Opening a file that is already open switches to its tab, so opening never closes or replaces a document. Each tab keeps its own unsaved edits, undo history, place in the document, and search.

Choose a tab to switch to it. `Mod+Tab` and `Mod+Shift+Tab`, or `Mod+PageDown` and `Mod+PageUp`, move to the next and previous tab, and `Mod+1` to `Mod+8` jump to a tab by position, `Mod+9` to the last one. A dot on a tab marks unsaved changes. **File > Close document** (`Mod+W`), a tab's close button, or a middle click closes it, asking first if it has unsaved changes. Closing the window or the folder asks once about every tab with unsaved changes.

A newly opened document starts at the top. Following a heading link or choosing a search result instead brings its target into view.

On Windows, installing Leafdown adds it to File Explorer's **Open with** menu for these files and to **Settings > Apps > Default apps**, without changing which app opens them by default. Choose Leafdown there to open Markdown files from File Explorer. Files associated with Leafdown show a folded-page icon with the green leaf and Markdown symbol. Each file opened this way starts its own Leafdown window, with the file's folder as context. **File > Open** works either way.

The welcome screen and **File > Open recent** show previously opened files and folders when **Record recent files and folders** is on. You can remove one recent item or clear both lists without deleting files. See [Settings reference](settings-reference.md) for the setting.

## Work in the article navigator

Choose a Markdown file row to open it. A row's context menu can create a file or folder, rename or delete an entry, reveal its location in the system file manager, or copy its absolute or folder-relative path. Empty navigator space offers actions for the folder root. New files open after creation. Deleting asks for confirmation and moves an entry to the system Recycle Bin or Trash; Leafdown does not permanently delete it on its own. Renaming an open file keeps its unsaved edits and updates its recent path. Links in other files are not rewritten.
Choose a Markdown file row to open it. A row's context menu can create a file or folder, rename or delete an entry, reveal its location in the system file manager, or copy its absolute or folder-relative path. Empty navigator space offers actions for the folder root. New files open in a new tab. Deleting asks for confirmation and moves an entry to the system Recycle Bin or Trash; Leafdown does not permanently delete it on its own. Deleting an open file closes its tab. Renaming an open file keeps its unsaved edits and updates its recent path. Links in other files are not rewritten.

The navigator also lists the folder's other files, such as images and PDFs, dimmed. Leafdown can only open Markdown files, so choosing one of them does nothing, and its context menu does not rename or delete it. A folder holding only such files can still be expanded, while an empty folder has no arrow.

## Search the folder

**Edit > Find and replace > Find in folder** (`Mod+Shift+F`) turns the sidebar into a search of the open folder's Markdown files, the same files the navigator opens. Type to search; matching works as **Find** does inside a document, with **Match case** and **Whole word**, and the open document is searched as you have it, unsaved edits included. Matches are grouped by file, with the text around each one. Choose a match, or move to it with the arrow keys and press `Enter`, to open its file and highlight the match while you stay in the results. Files that are too large or not valid UTF-8 or UTF-16 are skipped and listed. `Escape` returns to the navigator and to the document, with the match selected.
**Edit > Find and replace > Find in folder** (`Mod+Shift+F`) turns the sidebar into a search of the open folder's Markdown files, the same files the navigator opens. Type to search; matching works as **Find** does inside a document, with **Match case** and **Whole word**, and every open document is searched as you have it, unsaved edits included. Matches are grouped by file, with the text around each one. Choose a match, or move to it with the arrow keys and press `Enter`, to open its file in a tab and highlight the match while you stay in the results. Files that are too large or not valid UTF-8 or UTF-16 are skipped and listed. `Escape` returns to the navigator and to the document, with the match selected.

## Replace across the folder

**Edit > Find and replace > Replace in folder** (`Mod+Shift+H`), or the arrow before the search field, shows a **Replace with** field. While it shows, the view previews every change instead of searching: each match is shown struck through with its replacement beside it, across every file, however many there are. Nothing is written until you choose **Replace all**, which appears once the preview is complete; changing the search, the replacement, or an option first changes nothing.

**Replace all** writes each file in turn and then reports what it did. Only the lines holding a replacement change; a file marked with a warning sign is written as **Save** would write it, which can also change other lines, such as the padding of a table. If the open document has unsaved changes and is part of the preview, you are asked to save or discard them first, and the preview updates before anything is written. A file that changed since the preview is left alone and listed, as is any file that cannot be written, and the other files are still replaced.
**Replace all** writes each file in turn and then reports what it did. Only the lines holding a replacement change; a file marked with a warning sign is written as **Save** would write it, which can also change other lines, such as the padding of a table. If open documents with unsaved changes are part of the preview, you are asked to save or discard each of them first, and the preview updates before anything is written. A file that changed since the preview is left alone and listed, as is any file that cannot be written, and the other files are still replaced.

A replacement cannot be undone across files. In the open document, **Undo** undoes it for that document only; other files keep their new text, so commit or back up your notes first if you may want them back.
A replacement cannot be undone across files. In an open document, **Undo** undoes it for that document only; other files keep their new text, so commit or back up your notes first if you may want them back.

## Drop a file or folder

Expand All @@ -46,4 +52,4 @@ Local images render when available. A remote `https:` image remains a placeholde

## Save and external changes

**File > Save as** writes the document to a chosen path. Saving outside the current folder does not switch that folder. Leafdown watches the open file: a clean document reloads after another program changes it, while an edited document keeps its changes and warns. Saving over an externally changed file asks first. If the file has disappeared, Save offers Save as. These checks also apply to a file opened outside the pinned folder.
**File > Save as** writes the document to a chosen path. Saving outside the current folder does not switch that folder, and a file open in another tab cannot be saved over. Leafdown watches every open file: a clean document reloads after another program changes it, while an edited document keeps its changes and warns. Saving over an externally changed file asks first. If the file has disappeared, Save offers Save as. These checks also apply to a file opened outside the pinned folder.
2 changes: 1 addition & 1 deletion docs/help/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ Click in the document and type. Leafdown shows Markdown as formatted text while

Choose **File > Save** to write changes. Saving an untitled document opens **Save as**, where you choose its filename and location. **File > Save as** also writes an existing document to a new path. A file saved outside the open folder does not replace that pinned folder context.

When you close a document, open another, or leave the app with unsaved changes, Leafdown asks whether to save, discard, or cancel. Cancel leaves the current document open. If another program has changed or removed the file, Leafdown warns before a save can overwrite it or offers Save as for a missing file.
Opening a document never closes another: each opens in its own tab. When you close a tab, the folder, or the window with unsaved changes, Leafdown asks before discarding them, and canceling keeps everything open. If another program has changed or removed the file, Leafdown warns before a save can overwrite it or offers Save as for a missing file.

Continue with [File and folder workflows](file-and-folder-workflows.md) or [Settings reference](settings-reference.md).
5 changes: 5 additions & 0 deletions docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ In the folder search view, `Enter` in the query field searches at once and `Arro
- **Command palette...** (`Mod+Shift+P`)
- **Toggle sidebar** (`Mod+Shift+E`)
- **Toggle status bar**
- **Next tab** (`Mod+Tab` / `Mod+PageDown`)
- **Previous tab** (`Mod+Shift+Tab` / `Mod+PageUp`)
- **Outline** (Deferred)
- **Zoom in** (`Mod+=`)
- **Zoom out** (`Mod+-`)
Expand All @@ -259,6 +261,8 @@ In the folder search view, `Enter` in the query field searches at once and `Arro
- **Collapse all folders**
- **Expand all folders**

`Go to tab 1` through `Go to tab 8` (`Mod+1` through `Mod+8`) and `Go to last tab` (`Mod+9`) are not in a menu; they are run from their shortcuts or the command palette.

#### Help Menu

- **What's new...**
Expand Down Expand Up @@ -332,6 +336,7 @@ A submenu trigger carries the same state as the commands behind it: it is disabl
- Exception: `Insert final newline on save` remains enabled because it controls a global save setting rather than active editor content.
- `Export`, `Print`, and `Outline` are disabled when no document is open.
- `Save` is disabled when no document is open, or when the document is clean and already saved.
- `Next tab` and `Previous tab` require a second open document; they move in tab order and wrap at either end. `Go to tab 1` through `Go to tab 8` require a tab at that position, and `Go to last tab` requires an open document.

#### Selection And Editor State

Expand Down
Loading