An open API service indexing awesome lists of open source software.

https://github.com/autholykos/liauth

Markdown editor with live preview and embedded git versioning
https://github.com/autholykos/liauth

Last synced: 5 days ago
JSON representation

Markdown editor with live preview and embedded git versioning

Awesome Lists containing this project

README

          

# Liauth

A markdown editor that doesn't suck: Typora-style live preview with an embedded
git engine for versioning and asynchronous review.

## What it does

- **Live preview editing** — the markdown source is the document. Syntax
markers (`#`, `**`, `` ` ``, `[]()`, `>`, `-`) render in place and reveal
themselves only where your cursor is, Typora-style. Task-list checkboxes are
clickable.
- **Versioning built in** — every save is a git commit (skipped when nothing
changed). The History panel lists versions of the open file; any version can
be viewed read-only or restored.
- **Review workflow** — create a review branch for a second pair of eyes, both
sides edit independently, then "Merge in" reconciles. Conflicts appear as
standard `<<< >>>` markers right in the editor; saving while a merge is in
progress concludes it with a proper two-parent merge commit. Aborting
restores the pre-merge state.
- **Notes** — review annotations stored as CriticMarkup in the text itself
(`{== span ==}{>> comment <<}`), so they version, branch, and merge like
any other edit. Select text and hit ⌘⇧M; the live view shows a highlight
with a hover bubble, the Notes panel lists/jumps/resolves them, and PDF
export strips them.
- **RSVP speed reading** — ⌘⇧R (or `:rsvp`) flashes the document one word at
a time, Spritz-style, starting at the cursor: fixed optimal-recognition
pivot, sentence/paragraph-aware pacing, 100–900 WPM (↑/↓), arrows to step,
Esc drops the cursor where you stopped. Markdown syntax and notes are
stripped from the word stream.
- **Concurrent-write detection** — the open file is watched; external writes
reload automatically when the buffer is clean, merge automatically (diff3,
same algorithm as git) when both sides changed compatibly, and otherwise
offer Merge-with-markers / Keep mine / Take disk. A toolbar ↻ reloads on
demand.
- **PDF export** — renders the document to HTML (markdown-it + DOMPurify) and
hands it to the system print dialog (Save as PDF on macOS).

## Architecture

| Layer | Choice | Why |
|---|---|---|
| Shell | Tauri 2 (Rust) | small binaries, first-class libgit2 access |
| Git engine | `git2` (libgit2 bindings) | in-process, no shelling out — `src-tauri/src/git.rs` |
| Editor | CodeMirror 6 + Lezer markdown | text stays the document model, so git diffs stay meaningful — `src/editor/` |
| UI | React + TypeScript | toolbar, history/review panels — `src/App.tsx` |

Documents stay **plain `.md` files on disk**; the repo lives in the document's
folder. Files remain fully usable with any other tool, including plain `git`.

Real-time co-editing is deliberately out of scope for v1; the document layer is
plain text end to end, so a CRDT (Yjs/Loro) can be layered on later without
changing the storage model.

## Development

```sh
npm install
npm run tauri dev # run the app
npm run build # typecheck + bundle frontend
cd src-tauri && cargo test # git engine end-to-end tests
```

## Releases

Updates are served from GitHub Releases. The app checks:

```text
https://github.com/autholykos/liauth/releases/latest/download/latest.json
```

To publish an update, bump the version in `package.json`,
`src-tauri/Cargo.toml`, and `src-tauri/tauri.conf.json`, then push a matching
tag:

```sh
git tag app-v0.1.1
git push origin app-v0.1.1
```

The release workflow signs updater artifacts with the
`TAURI_SIGNING_PRIVATE_KEY` GitHub Actions secret and uploads `latest.json`.