PyMarkdownEditor aims to become an extremely user-friendly, powerful Markdown editor where Markdown feels natural, intelligent, and fluid — while preserving:
- Deterministic behavior
- Clean architecture
- Offline-first capability
- Plugin-first extensibility
AI is an optional capability layer, not the product’s core identity.
Make Markdown feel effortless:
- Selection-aware formatting
- Context-aware link/code/list handling
- Inline helpers that never interrupt writing flow
- Diff-based transformations instead of destructive rewrites
Markdown remains primary. Intelligence augments it.
Plugins are first-class citizens.
- Stable
IAppAPIcontract - Built-in plugins serve as reference
- External plugins via entrypoints
- Clear governance model for plugin acceptance
The editor core remains minimal and stable.
AI features must be:
- Opt-in
- Deterministic when disabled
- Transparent (diff previews, sources shown)
- Explicit (no silent edits)
- Private (clear visibility of what data is sent)
AI enhances editing — it does not replace it.
Add a first-class Settings UI to expose configurable behaviour safely and consistently.
- Dedicated Settings dialog (tabbed; searchable)
- Rendering configuration (preview engine, Markdown extensions, CSS/theme)
- Editor UI preferences (wrap, font, tab width, preview visibility)
- Plugin management entry-point and plugin-specific settings
- AI configuration (provider selection, tokens, model settings)
- Import/export of settings (optional; later)
- All settings are explicit, discoverable, and reversible.
- Settings changes are safe-by-default (no destructive actions).
- AI credentials/settings are stored securely (OS keyring where possible).
- Plugin settings are namespaced (e.g.
plugins/<plugin_id>/...).
Build infrastructure without altering core editing behavior.
IAIClientprotocolAIRequest,AIResponse,AIError- Provider adapters (OpenAI, Anthropic; local LLM later)
- Structured metadata (tokens, latency, model info)
- Feature flag:
ai/enabled = falseby default - Settings UI for provider + model configuration
- No UI logic in core AI layer
- All AI outputs structured and inspectable
- Cancellation + rate limiting support
Introduce optional document-aware intelligence.
- Chunk current document
- Chunk open project folder
- Return ranked chunks with citations
- Local vector store only
IEmbeddingClientIVectorStoreRetrievalQuery- Citation metadata model
Hybrid retrieval and remote stores remain future considerations.
Agents are structured tools, not chatbots.
IAgent:
idnamedescription- supported
modes run(context) -> AgentResult
AgentResult supports:
- Suggested edits (patch/diff)
- Commentary
- Citations
- Structured output
- UK English enforcement
- Grammar and clarity checks
- “Light touch” vs “Strict” mode
- Diff-based output only
- Notes → polished copy
- Preset templates (LinkedIn, email, blog)
- Brand voice profiles
- Outline generation
- Chapter scaffolding
- Terminology consistency via project retrieval
Future agents may include:
- Technical Writer
- Summariser / Task Extractor
- Documentation Assistant
- Curriculum Vitae Writer
AI must feel native, not bolted on.
- Agent selector
- Scope selector (selection / document / folder)
- Output mode (suggest / comment-only)
- Diff view with accept/reject controls
- Citation viewer
Modes:
- Proofread Mode
- Copywriter Mode
- Book Planner Mode
- Agents packaged as plugins
- Built-in agents serve as reference implementations
- External agent repositories supported
- Governance and signing model defined
The Settings dialog is the home for all configurable behaviour, including rendering options and AI credentials.
- General
- Editor
- Preview & Rendering
- Export
- Plugins
- AI
- Privacy & Safety
- Advanced / Diagnostics
The goal is to expose meaningful options without making the UI noisy. Defaults remain sensible.
ui/theme: default / midnight / paperui/language: (future) en-UK defaultui/restore_session: reopen last files (future)ui/telemetry: off by default (likely never)
editor/font_familyeditor/font_sizeeditor/tab_width_spaceseditor/line_wrap: on/offeditor/show_line_numbers: (future)editor/highlight_current_line: (future)editor/auto_pair_brackets: (future)editor/smart_paste_links: on/offeditor/smart_format_toggles: on/off (bold/italic toggles)editor/trim_trailing_whitespace_on_save: (future)
render/engine:text(QTextBrowser) /web(QWebEngineView) /autorender/webengine_enabled: true/false (alias for env override)render/refresh_mode: on-change / debouncedrender/debounce_ms
Expose safe toggles mapped to python-markdown extensions:
render/md_extensions/extra: on/offrender/md_extensions/fenced_code: on/offrender/md_extensions/codehilite: on/offrender/md_extensions/toc: on/offrender/md_extensions/sane_lists: on/offrender/md_extensions/smarty: on/offrender/pymdownx/enabled: on/off (master toggle)render/pymdownx/arithmatex: on/off- (future) other pymdown extensions
render/css/theme: default / customrender/css/custom_path: path to custom CSS file (future)render/open_external_links: on/offrender/allow_remote_images: on/off (default off for privacy)
export/default_format: html/pdfexport/pdf_engine: classic/webengineexport/pdf_page_size: A4/Letterexport/pdf_margins_mm: (top/right/bottom/left)export/html_embed_css: on/offexport/open_after_export: on/off (future)
plugins/enabled: master toggle (future)plugins/allow_external_installs: on/offplugins/require_signed_plugins: (future)plugins/catalog_url: (future)- plugin-scoped keys:
plugins/<plugin_id>/<key>(via AppAPI get/set plugin setting)
privacy/send_selection_only_by_default: true/falseprivacy/confirm_before_ai_send: true/false (default true)privacy/redact_secrets: on/off (future secret scanning)privacy/allow_project_folder_rag: on/offprivacy/allow_file_paths_in_prompts: on/offprivacy/log_ai_requests_locally: on/off (default off)
diagnostics/show_loaded_config_path: on/offdiagnostics/show_plugin_errors: on/offdiagnostics/ai_trace_level: off/basic/verbosediagnostics/rag_index_stats: on/off
Settings must be separated into:
- Global AI settings (affect all providers)
- Provider-specific settings (OpenAI/Anthropic/etc.)
- Model/runtime settings (per-provider, per-agent, per-task)
These apply regardless of which API is selected.
ai/enabled: true/false (default false)ai/provider:openai/anthropic/local/noneai/default_agent:proofreader/copywriter/book_plannerai/streaming: on/off (if supported)ai/timeout_secondsai/max_retriesai/backoff_strategy: fixed/exponentialai/request_concurrency: (future)
ai/output_mode_default: diff/comment-onlyai/require_diff_for_edits: true/false (default true)ai/show_citations: true/false (default true for RAG agents)ai/uk_english_default: true/falseai/safety_level: strict/standard (future)
ai/scope_default: selection/documentai/include_document_title: on/offai/include_front_matter: on/off (future)ai/include_project_context: on/off (requires RAG)ai/max_context_chars: guardrailai/max_tokens_output: guardrail
rag/enabled: true/falserag/scope: selection/document/projectrag/top_k: e.g., 5/10/20rag/min_score: thresholdrag/index_on_open: on/offrag/index_on_save: on/offrag/chunk_size: e.g., 800 charsrag/chunk_overlap: e.g., 120 charsrag/vector_store: local (default)rag/cache_embeddings: on/offrag/cache_max_mb
ai/credential_store: keyring/file (keyring preferred)ai/api_key_ref: keyring lookup key (not plaintext)
These keys live under a provider namespace:
ai/openai/api_key_refai/openai/base_url(optional; for proxies/enterprise)ai/openai/org_id(optional)ai/openai/project_id(optional)ai/openai/default_modelai/openai/reasoning_effort(if supported by chosen model family)ai/openai/temperature_defaultai/openai/top_p_defaultai/openai/max_output_tokens_default
ai/anthropic/api_key_refai/anthropic/base_url(optional)ai/anthropic/default_modelai/anthropic/temperature_defaultai/anthropic/top_p_defaultai/anthropic/max_output_tokens_default
ai/local/provider: ollama/lmstudio/customai/local/base_urlai/local/default_modelai/local/embedding_modelai/local/context_window_tokens
Agents should have configurable behaviour independent of provider.
Namespace pattern:
ai/agents/<agent_id>/...
ai/agents/proofreader/strictness: light/standard/strictai/agents/proofreader/focus: grammar/clarity/tone/allai/agents/proofreader/preserve_style: on/offai/agents/proofreader/avoid_rewrites: on/offai/agents/proofreader/prefer_uk_spelling: on/offai/agents/proofreader/formatting_policy: preserve/normalize
ai/agents/copywriter/tone: formal/neutral/warmai/agents/copywriter/length: short/medium/longai/agents/copywriter/audience: free textai/agents/copywriter/brand_voice_profile: profile idai/agents/copywriter/templates_enabled: on/off
ai/agents/book_planner/genreai/agents/book_planner/target_length_wordsai/agents/book_planner/chapter_count_targetai/agents/book_planner/style_constraintsai/agents/book_planner/glossary_mode: off/onai/agents/book_planner/outline_format: bullets/headings/json
- AI interfaces
- Feature flag
- Settings dialog scaffolding (tabs + storage)
- Rendering options exposed safely
- Local document indexing
- Citation support
- Deterministic test suite
- Proofreader
- Copywriter
- Book Planner
- Diff/patch system
- Agent plugin loading
- External extension documentation
- Governance documentation
- Offline-first remains default.
- No AI dependency required.
- Deterministic tests (AI fully mockable).
- API keys stored securely (OS keyring).
- Clear visibility of transmitted content.
- Background indexing only; no UI blocking.
- Bounded embedding cache storage.
PyMarkdownEditor is:
- A Markdown editor first.
- An extensible platform second.
- An AI-capable editor third.
It is not:
- A chat application.
- A cloud-dependent writing platform.
- A replacement for deterministic editing.