Part of the Lekhak guide.
Bring work in and keep it safe
Importing
Bringing your work in
File → Import Markdown… reads a markdown file and makes documents out of it. Markdown import can read Lekhak’s own markdown export format (markdown with a YAML block above each heading) and markdown exported from other writing software, as long as the file is structured clearly enough for Lekhak to read.
For the smoothest result, export your work as one markdown file in the correct sequence. Lekhak can split that file into documents by headings and build a tree from it. If your source project has metadata you want to keep, include it in YAML blocks so Lekhak can read it as fields. World-building material such as character, location, item or story-arc notes can be imported as regular content documents in the same way.
File → Import from Lekhak Project… lets you bring folders or documents from another Lekhak project into the current one. Choose the source project, select what you want to import, and Lekhak copies it into the current project (under the selected container, or at the top level) with its structure, order, content, metadata, type and template information.
Imports land under whatever you had selected in the binder — or at the top of the tree when you had nothing selected.
What survives
Information that is present in the imported markdown can be brought in, but it is your responsibility to ensure the file contains what you need. Metadata included in YAML blocks can be read into fields; the rest of the content is imported as text.
When a YAML value is read, Lekhak chooses a field type from what it sees: an ISO date becomes a Date field, true or false becomes a Checkbox, and anything else is Text. This recognition can be wrong; you can change a field’s type afterwards if needed.
Some names are handled specially during import. Template and Template config are treated as design markers rather than ordinary metadata fields. Type is kept as the document’s role. If imported names conflict with names Lekhak reserves, the result may need adjustment after import.
Project-level keys (such as Author, Title or Copyright) fill the project’s own fields only where you have not already set them. Values you have already set are kept.
Markdown import has not been robustly tested across every writing tool and export style. It is included because writers often need to bring existing projects in, but mapping one customisable tool’s export to another’s structure can be complicated. Expect to review and tweak the result, especially for heavily customised projects, and report problems on GitHub if you run into them.
The tree
Markdown import works best when the file already expresses structure. A single file exported in the correct order is easier to bring in than many separate pieces: Lekhak can read nested headings, split the document into sections, and place those sections into the binder as a tree.
Headings and document structure in the file are used to infer chapters, scenes and containers. When a scene in an export does not state a parent, it may be placed under the chapter before it, in the order the export wrote. The exact result depends on how clearly the source export marks structure, so some rearranging may still be needed after import.
If you want metadata to travel with the text, include it in a YAML block where it belongs. For example, to keep per-scene notes from another tool, you can export or add a block like this before the scene text:
—
Characters: Tom, Dick, Harry
Location: Fantasy Land
Magical item: wand, unicorn
—
Lekhak can read those keys as metadata fields for the imported document or scene. The key is to make sure the information you care about is actually written into the markdown you export, not only stored inside the original application.
Nothing is overwritten
An import only adds. It never touches a document you already have, and it never replaces a file you have written. If something goes wrong, the imported documents are simply documents you can delete.
Exporting back out
Markdown export is not currently available. For now, use the other export formats (such as plain text, HTML, DOCX, PDF or EPUB) depending on what you need the output for.
Versions and safety
Snapshots
Document → Create Snapshot… keeps a named copy of the document as it is now. Snapshots are kept until you delete them.
Make one before a big change — a split, a merge, or a rewrite of a chapter — and if the change was a mistake, Restore Snapshot… puts the document back as it was in that snapshot.
Backups
Ctrl+S saves the project and can create a backup. A backup is a full copy of the project folder as it stands, stored outside the project.
File → Choose Backup Folder… sets where backups are stored. If you do not choose a folder, backups are placed in a Backups folder beside the project, in a subfolder named after the project. Keeping backups outside the project means they are not lost if the project folder itself is deleted or damaged.
You can choose how often automatic backups are made in Preferences → Files & saving (for example on close, hourly, daily, weekly, every save, or never automatically). If you use Ctrl+S out of habit, a less frequent schedule can help avoid filling your backup folder with many near-identical copies.
Backup copies are named with timestamps. Lekhak avoids creating a new timestamped backup when nothing has changed since the last backup, and it prunes older timestamp-named backups automatically. To keep a particular backup from being removed by automatic pruning — for example, one taken before a major change — rename it so it no longer follows Lekhak’s timestamp naming (for example, backup-1Dec2026).
The trash
Deleting a document moves it to the trash folder. The trash is a normal folder in the binder: you can look in it, drag something out of it, or empty it when you are sure.
Files in the trash keep a folder structure that mirrors where they came from. Restoring a file returns it to that original location by default; if you want it somewhere else, you can drag and drop it to the desired place in the binder.
Tracked changes
Tracked changes can be useful for collaboration, or when you want to review an edit later before deciding to keep it.
Content inserted or changed using the AI feature is always tracked, so you can accept or reject those suggestions.
Edit → Accept All Changes in Section and Edit → Reject All Changes in Section work on the document you are in. Revision Passes… keeps a set of named edits and works through them one at a time, so a pass of line edits can be handled deliberately rather than in one sweep.
Revision author is set in Preferences so tracked changes carry your name. Revision Passes… (Edit menu) keeps named passes over the manuscript so you can work through sets of edits deliberately.
Locking
A folder or document can be locked: it stays readable but cannot be written to, and everything inside a locked folder is locked too. This can be useful for already published books in a series, completed chapters, or other content you may need to refer to often but do not want to alter accidentally. The lock lets you open and read the content while keeping the file read-only.
Your files are your files
A Lekhak project is a folder on disk: your documents live in the folder tree, with files such as manifest.json, per-folder .order.json files, images/, templates/, trash/, and project.sqlite3 (used by Lekhak as an index). You can copy the folder, back it up, or keep it in version control like any other files.
If you ever need to access the project without Lekhak, the structure is readable: manifest.json records the root order, each folder’s .order.json records that folder’s sequence, and each document file carries its metadata as YAML in the head alongside the content. A regular file manager may sort files alphabetically or by date, but these files preserve the project’s intended order and metadata so your work remains accessible.
Backups go to a per-project backup location by default and can be scheduled (daily/weekly/on close); renamed backups are kept. Images live under the project in images/ and are referenced by the manuscript. Recent projects lists projects you have opened.