Start the Go editor for a cloned site:
markata editor --workspace ~/git/my-site --port 8002
For the Python example, set MARKATA_LSP_WORKSPACE to the same site directory
before starting examples/fastapi_editor.py.
The Files tree lists content discovered by Markata's glob plugin. The editor
reads markata-go.toml, YAML, or JSON configuration from the selected workspace.
It uses the configured glob patterns and gitignore behavior. Without a config,
it discovers Markdown under pages/ and posts/ with Markata's defaults. The Tags view groups
loaded documents by their frontmatter tags.
Select a file to load its original source, including frontmatter. Edit it and
view the Go-rendered preview. Drafts stay in browser storage, scoped to the
workspace and path. Switching files keeps each draft. Download .md exports
the active draft. This iteration does not write changes to the cloned files.
The scratch draft.md buffer remains available for imported documents.
Only discovered files inside the selected workspace can be read. Files reached through symlinks outside the workspace are excluded. Source reads are limited to 200,000 bytes; a failed read leaves the current editor buffer intact.
API usage
Go applications can use editorworkspace.New(root), Files(), and Read(path)
from github.com/WaylonWalker/markata/pkg/editorworkspace. Discovery uses the
existing glob and load plugins without running a site build.
Python applications can use the same implementation through the bundled binary:
from markata import workspace_files
listing = workspace_files("/path/to/site")
source = workspace_files("/path/to/site", path="posts/hello.md")["source"]
The CLI exposes the JSON interface as markata workspace --workspace /path/to/site
and markata workspace --workspace /path/to/site --file posts/hello.md.
The Go and FastAPI servers provide GET /workspace and
GET /workspace/file?path=posts/hello.md. The browser loads source on demand.
See the Go editor guide and Python editor guide.
Site defaults
When the selected workspace has a config, the editor applies its palette,
light/dark fallback, aesthetic, fontpack, text size, palette variables, custom CSS,
and Markdown highlighting settings. Local palettes/ and aesthetics/ catalogs
resolve from that workspace, as does an explicit fontpacks_file.
Saved browser appearance preferences take priority over site defaults.
The preview remains an article preview; it does not run page templates or a site build.
Python hosts can pass workspace="/path/to/site" to appearance(), render(),
and render_async(). The JSON command equivalent is
markata render --workspace /path/to/site --json (Markdown on stdin), or
markata render --workspace /path/to/site --appearance for controls and assets.
The editor first discovers paths and opens the selected source. Titles and tags
load afterward in the background. The Tags view becomes available when metadata
is ready and builds its tree when opened. Metadata errors do not block editing.
Use markata workspace --paths --workspace PATH or
workspace_files(PATH, metadata=False) for discovery without parsing documents.
Server clients can request GET /workspace?metadata=true when they need metadata.
If the workspace contains a real draft.md, the scratch buffer appears as
Unsaved draft.md (or a numbered variant if that name also exists). Imports
open the scratch buffer, and real workspace files retain their own browser drafts.
Reuse server state
The Go editor retains discovered paths and parsed document metadata for its workspace. Repeated file requests check cached membership and read only the selected source. The server reuses its Markdown renderer until the site configuration changes. Browser LSP sessions share parsed workspace data and keep unsaved documents private.
A filesystem watcher refreshes changed documents after a short delay. Configuration and appearance changes refresh the renderer on its next request. A periodic scan recovers missed filesystem events. The Files and Tags trees refresh when you reload the browser page.
Reopening a file or reloading the page loads its latest disk content if its browser draft has no edits. If the draft has edits, the editor preserves them. A warning identifies disk changes when the saved draft has a source version. Older saved drafts remain intact during migration. The editor does not write browser drafts to disk.
Go hosts can open retained state with editorworkspace.Open(ctx, root).
Use Paths(), Files(), Read(path), and Snapshot() for cached access.
Call Close() when the host stops, or cancel the parent context.
The existing editorworkspace.New(root) and Python helpers keep their one-shot behavior.