- C++ 73%
- Rust 27%
- CMake <1%
- Shell <1%
lbg #
A native KDE interface to a directory of Markdown files.
Browse and search filenames, paths, and contents; read formatted notes or their
original source. Outlines render their nested structure. Other Markdown documents
remain one document block. Logseq's ^^highlight^^ syntax renders with a yellow
background, including formatting inside the highlight. Tags and wiki links open
pages with linked references beneath their content. Click a block to edit its
Markdown while the other blocks stay rendered. Changes save after a short pause.
Ordinary newlines stay visible as line breaks when a block is rendered.
The notes panel sorts by file modification time, newest first. Saving updates the
order immediately while keeping the active editor; automatic refresh picks up
external changes. Equal timestamps use the note's path as a stable tie-breaker. Search keeps
this order within filename/path matches and content-only matches.
Run #
Requires Rust, a C++17 compiler, CMake, Ninja, and Qt 6 Widgets/Test development packages. KDE's Qt platform theme and Breeze style provide Plasma integration.
./run.sh '/home/roller/Documents/lbg test'
The launcher builds the app and opens the folder. Subsequent builds reuse their
artifacts. You can also launch ./build/lbg directly. Without a folder argument,
the app restores the last folder; use File → Open Folder to choose another.
The installed application-launcher entry is lbg, with the native text-editor
icon. It opens the current executable in build/, without rebuilding or opening
a terminal. After moving the checkout, build again and reinstall the generated
entry with install -Dm644 build/lbg.desktop ~/.local/share/applications/lbg.desktop.
- Ctrl+O: choose a folder.
- Settings → Configure lbg… / Ctrl+,: set startup behavior, note and monospace code fonts/sizes, task and graph defaults, and the calendar's first weekday. Startup → Automatically refresh notes is enabled by default. Applying it after a pause catches up on changes made while disabled. Font previews are local to the dialog until Apply or OK. Cancel discards pending changes; Restore defaults stays pending until applied.
- Today / Ctrl+T: open today's journal ready to write. Reuse an existing dated
note, or explicitly create an empty
journals/YYYY-MM-DD.md. - Journals / Ctrl+J: browse existing entries newest first. Edit blocks directly in the feed; Show older entries loads more, and Open page opens one day.
- Tasks / Ctrl+Shift+T: see tasks across all notes, grouped by note. Search tasks, toggle checkboxes, or Open in note (Enter). Completed tasks are hidden until you enable Show completed. Ctrl+Z / Ctrl+Shift+Z undoes/redoes task changes.
- Tasks → View → Month / Week: browse task counts or a table with one column per day and task blocks beneath it, with checkboxes and no hour labels. Click a day header (or press Enter on a focused calendar day) to open/create its journal. Changing months/weeks only browses. Undated tasks stay in List.
- Schedule…: pick a date for a selected task in List or Week. This saves a link
such as
[[2026-10-08]]in the original task; the journal is created when opened. You can also write the link yourself in any note. The first valid dated wiki link sets the day; otherwise tasks in a journal use that journal’s date. - Graph / Ctrl+G: explore pages connected by links and tags. Choose the whole notebook or the current note and its direct neighbors. Faded dotted nodes are uncreated pages; Show ghost pages controls their visibility. Linked groups spread out automatically, with room between disconnected groups and slightly larger hubs. The overview keeps labels sparse; zoom in to reveal more names, or hover/select a node. Labels retain a readable font size.
- Graph navigation: drag nodes to arrange them, drag the background to pan, scroll or use Zoom in / Zoom out, and Fit to show everything. Arrows select nodes and Enter opens them. Find page selects without writing; clicking a node or Create and open explicitly creates a ghost's empty file. Refresh reloads the graph; entering it saves first and preserves conflicting drafts.
- Ctrl+P / Ctrl+Shift+F: focus search. Search matches all entered words, case-insensitively, across names, paths, and Markdown content.
- Down from search: enter the note list. Arrow keys select notes.
- Enter: open the selected result, or activate the explicit Create… choice. Selecting a Create choice previews it without writing a file. Filename/path matches come first, followed by Create, then content-only matches.
- Ctrl+E: switch rendered note / read-only Markdown source.
- Click a block: edit its source. Click its bullet / Esc from editing: select the rendered block. ↑ / ↓: select the previous / next visible block, skipping folded children; in Journals, continue between loaded days.
- Type / Enter / F2 on a selected block: start editing. Typing appends to its existing source. ← / → on a selected block: edit at the beginning / end.
- Arrow keys while editing: move the caret normally; ↑/↓ at the first/last visual line continue into the adjacent block at the same column. ←/→ at the beginning/end continue into the previous/next block.
- Backspace on an empty outline block: delete it and move to the previous visible block. Children move up a level and stay intact. The final empty page stays editable. Undo/redo includes deletion.
- Click a task checkbox / Space when focused: check or uncheck a task and save.
Tasks use
[ ]/[x]at the start of a Markdown list item;[]is also accepted as unchecked shorthand. Toggles write standard[x]/[ ]and support undo/redo. - Enter in an outline: split into a new sibling, retaining existing children under the first block. Shift+Enter: a newline within the block. Document blocks use ordinary Enter for newlines.
- Tab / Shift+Tab in an outline: indent / outdent the current block and its children. Indenting places it under the preceding sibling; outdenting leaves other children with their parent.
- Click a block's arrow / Ctrl+. within a block: fold / unfold its children. On a leaf block, the shortcut toggles its nearest parent. Folded parents stay editable, and nested folds are retained when expanding an ancestor.
- Ctrl+S: save immediately. Typing also saves after 600 ms, and navigation saves before leaving a note.
- File → Recover Drafts…: review local recovery copies after an interrupted edit. A notice appears when copies are available, including before opening a folder. Preview the recovered text beside the current note, restore it into the editor, copy it, or explicitly discard its recovery copy. Restoration waits for Ctrl+S or a fresh edit before saving. Existing external-change checks remain active; recovery never recreates a deleted note.
- Ctrl+Z / Ctrl+Shift+Z: undo / redo, including block creation, deletion, and hierarchy moves.
- Esc / Ctrl+Enter while editing: finish, render, and select the block.
- Esc elsewhere: clear search and return to it.
- F5: refresh notes after changes from Nextcloud or another editor. Automatic refresh also watches nested folders and sync-style file replacements, preserving your editor, reading position, filters, and graph arrangement. If the current file changes while editing, an inline notice keeps your draft with Copy draft and Reload from disk…. Reload asks before discarding unsaved edits. Deleting a file externally never causes lbg to recreate it.
Both .md and .markdown files are included. Duplicate filenames stay distinct
through their relative paths. Unreadable/non-UTF-8 files produce a visible folder
warning and do not prevent other notes from opening. .git and symlinks are
excluded from traversal. #page, #[[page with spaces]], and [[page]] refer to
the same pages. Links resolve qualified paths or unique filenames; ambiguous names
show feedback and require a path. Opening a missing target creates an empty .md
file at the folder root, or in matching subfolders for qualified names. Markdown
relative links also work and contribute backlinks. Linked references show source
pages and snippets at the bottom of each note.
Journals recognizes valid YYYY-MM-DD and YYYY_MM_DD filenames anywhere in the
folder, with either Markdown extension. Duplicate dates remain separate; Today
asks which page to open if several match. Calendar days use the same behavior.
Bare dated wiki links also reuse an existing journal, or explicitly create one in
journals/. Scheduling accepts dated links with qualified paths, either Markdown
extension, and underscore dates. Code and escaped links are ignored. Opening the
feed or browsing calendars never creates notes.
Untouched blocks and frontmatter retain their exact bytes. Editing preserves the
note's line-ending style. The full Markdown source viewer remains read-only and
includes your pending draft, so it can be copied if a save fails.
Local images render inline in notes, outline blocks, and journals.
Large images shrink to the reading area's width, retaining their proportions as
you resize the window or sidebar; small images retain their natural size.
Relative paths start from the note's directory. Absolute paths and file:/// URLs
work too, including images outside the notebook. Local file links open attachments in your
desktop's associated app, inside or outside the notebook; internal Markdown files
open as lbg notes. Outside Markdown files open in their associated app and are
never imported or created by lbg. Examples:


[PDF](../assets/paper.pdf)
[Outside file](<file:///home/roller/Documents/my paper.pdf>)
You can also percent-encode spaces as %20 and literal # as %23. Reading never
opens attachments automatically or changes image files. Remote images are not
downloaded by the reader; image paste/drop and attachment insertion are not yet
implemented.
Check #
./build.sh
cargo test --locked
QT_QPA_PLATFORM=offscreen ./build/lbg-ui-tests
LBG_TEST_FOLDER='/home/roller/Documents/lbg test' QT_QPA_PLATFORM=offscreen ./build/lbg-ui-tests
Core tests cover arbitrary layouts, search, document preservation, full Markdown within outlines, external edits, tags, backlinks, and safe page creation. Native UI tests cover local image resources and file link routing, draft recovery after process termination, automatic refresh, conflicts, folder recovery, settings, font rendering, safe startup, page graphs, ghost creation, task lists, scheduling, month/week calendars, keyboard navigation, source/preview, rendering, refresh, link navigation, explicit creation, active-block editing, undo/redo, saving, journals, and file preservation.
Structure #
crates/lbg-core: Qt-free Rust library for folder loading, search, and parsing.crates/lbg-gui: a small CXX bridge and the Qt Widgets desktop interface.SPEC.md: agreed scope and reviewed iteration checkpoints.
Dependencies: pulldown-cmark parses Markdown (including wiki links); CXX/cxx-build joins Rust and C++; Qt Widgets renders text and supplies native controls; tempfile provides atomic temporary-file saving and scratch folders for tests. The Rust dependency versions are pinned in Cargo.lock. Source is 0BSD; Qt uses its own license and is dynamically linked.
Build output lives in target/ and build/. Both can be deleted and rebuilt.
Development builds omit debug information and incremental caches to keep artifacts
small. Browsing never rewrites notes. Typing, deleting an empty block, or toggling a task authorizes saving your changes;
activating a missing page creates its Markdown file. Saves use a temporary file in
the same directory and atomically replace the note, preserving its permissions.
If another app changes or deletes the file, saving stops and keeps your draft.
Navigation is blocked until the draft is saved or you explicitly discard it using
Refresh or when closing. Closing a conflicting or restored draft can also Keep
draft and close, retaining its latest recovery copy. The last folder is saved in
Qt's local application settings.
Unsaved edits have atomic recovery copies in the device's local application data directory, outside the notebook. Copies include the original source used by the save guard and survive app interruption or Keep draft and close. They are removed after saving, undoing all pending changes, or explicit discard. Unavailable notes/folders keep their copies for previewing and copying. Recovery write errors are shown in the window. No notebook files are added and recovery data does not sync with your notes.
Preferences stay in local app settings on this device. Fonts default to the system note and monospace fonts; the chosen code font also applies to inline code and Markdown source editing. Controls keep the native KDE font/theme. Startup views browse without creating notes. Disabling automatic folder reopening still allows an explicit folder argument. Task/graph defaults apply on entering the view; temporary view controls stay temporary and survive Refresh.
Fold state is also saved in local app settings, separately for each notebook/page. It survives reopening and stays on this device; Nextcloud syncs the Markdown notes. Saved folds match unique block subtrees by their content, so inserting an unrelated block doesn't shift the state onto the wrong row. Changed hidden content or ambiguous identical subtrees reopen expanded. Folding never modifies note files.
Nested unordered bullets are child blocks; ordered lists, quotes, code, and other Markdown can live inside a block. If a parent resumes prose after its children, the page opens as one document block so editing can preserve that ordering. Quote blocks use a vertical bar and a subtle background; code blocks have a darker background. These colors come from the native theme. Within a bullet, indent the code fence's contents and closing fence to keep them in that block.