Skip to main content

WYSIWYG editor for mkdocs-live-edit-plugin based on @celsowm/markdown-wysiwyg

Project description

mkdocs-live-wysiwyg-plugin

Try it out

There's a shell script which makes editing techdocs in this repository really quick.

Run ./techdocs-preview.sh from this repository to view the documentation for this repository.

For a general tutorial, you can run

techdocs-preview.sh init

The init command will initialize mkdocs documentation for you. The default docs serve as a tutorial to the WYSIWYG editor but you could also discard the documentation and use it as a starting point for your own project. init is intended to be a quick way to add documentation to a repository that did not previously have TechDocs.

Features

A WYSIWYG (What-You-See-Is-What-You-Get) editor for exiting mkdocs documentation.

See shortcuts and behaviors document for how to edit documents.

  • 🌈✨ Author quality of life features
    • 👁-👁 Focus mode with collapsible nav sidebar, editing tools, and table of contents.
    • ✅ Non-destructive WYSIWYG editing is a top priority. Minimal git diff .
    • ✅ Content refactoring with automated content migration.
      • Link refactoring when moving around documents.
      • Inner heading link refactoring when renaming headings within documents that are cross-referenced as links.
    • ✅ Editing preferences remembered across pages.
    • ✅ A URL pasted onto selected text creates a markdown link.
    • ✅ Automated content migration to mkdocs-nav-weight.
    • ✅ DAG-based undo/redo with branch picker for non-linear editing history. Undo works across markdown and WYSIWYG modes.
  • 🗂️ Navigation management
    • ✅ Sidebar nav editing: reorder pages and sections with keyboard shortcuts or mouse.
    • ✅ Create, rename, and delete pages and folders from the nav sidebar.
    • ✅ Move pages between folders (indent/outdent).
    • ✅ Group selection with Ctrl/Cmd+Click for batch operations.
    • ✅ Nav-specific undo/redo stack (separate from content undo).
    • ✅ Review Changes popup before saving.
    • ✅ Automated dead link detection and resolution.
    • ✅ mkdocs-nav-weight integration with migration wizard.
  • 💪 Mkdocs/backstage rendering features
    • ✅ Toggle-able checklists (task lists): - [ ] and - [x] .
    • ✅ YAML frontmatter preserved when editing and switching modes.
    • ✅ MkDocs admonitions (!!! note, !!! warning, etc.) with settings gear for type, collapsible, placement, and more.
    • ✅ Markdown link styles preserved (inline, reference, shortcut).
    • ✅ Code blocks with WYSIWYG editable titles, language selector, and auto-indent settings.
    • ✅ Mermaid diagram editing with an embedded live editor (full-screen overlay).
    • ✅ Tables with contextual toolbar: insert/delete rows and columns, column alignment, and formatting settings.
    • ✅ Image dialog with autocomplete from the docs tree.
    • ✅ Emoji shortcode completion and full emoji picker.
  • ℹ️ Other noteworthy features
    • ✅ Cursor location memory: when switching between WYSIWYG or Markdown modes the cursor location and scroll area is preserved to reduce editing strain on the author.
    • ✅ Selected text is preserved when the author switches modes (to/from wysiwyg or markdown).
    • ✅ Auto-conversions: typing markdown syntax (headings, lists, bold, inline code, etc.) in WYSIWYG mode converts live to formatted elements.
    • ✅ Balanced ASCII table formatting with configurable max width and per-table overrides.
    • ✅ Context-sensitive help panel (Ctrl+?).
    • ✅ No external JavaScript; all assets are bundled locally within the mkdocs plugin.

The following is an annotated screenshot after running techdocs-preview.sh init.

focus-busy

Requirements

  • Python 3.10 or higher.
  • mkdocs-live-edit-plugin (must be installed and configured)
  • mkdocs >= 1.5

Installation

pip install mkdocs-live-wysiwyg-plugin

Or with uv:

uv pip install mkdocs-live-wysiwyg-plugin

This will install mkdocs-live-edit-plugin as a dependency. For development setup, see CONTRIBUTING.md.

Configuration

Add both plugins to your mkdocs.yml. Important: live-edit must be listed before live-wysiwyg:

plugins:
  - live-edit
  - live-wysiwyg

Options

Option Type Default Description
autoload_wysiwyg boolean true Default behavior when no user preference cookie exists. If true, the WYSIWYG editor loads automatically when entering edit mode. If false, the plain textarea is shown initially with an "Enable Editor" button. Once the user explicitly enables or disables the editor, their preference is stored in a cookie and takes priority over this setting.
user_docs_dir string "" Override the docs source directory path. Useful when the monorepo plugin (e.g. techdocs-core) replaces docs_dir with a temporary directory. Falls back to the upstream mkdocs-live-edit-plugin's user_docs_dir, then to the MkDocs docs_dir.

Attributions

This plugin incorporates or depends on the following works:

Component Author License Link
@celsowm/markdown-wysiwyg (WYSIWYG editor) Celso Fontes MIT GitHub · npm
marked (Markdown parser) Christopher Jeffrey, MarkedJS MIT GitHub · marked.js.org
js-yaml (YAML parser) Vitaly Puzrin MIT GitHub
mermaid (Diagram renderer) Knut Sveidqvist MIT GitHub · mermaid.js.org
mermaid-live-editor (Diagram editor) Knut Sveidqvist MIT GitHub
mkdocs-live-edit-plugin (required dependency) Eddy Luten MIT GitHub

All listed components are distributed under the MIT License. See each project's repository for full license text.

All vendored JavaScript, CSS, and application builds are bundled locally in mkdocs_live_wysiwyg_plugin/vendor/ — no external JavaScript or CSS is loaded at runtime. See vendor/README.md for exact versions and license files.

MkDocs Theme Support

Only the Material for MkDocs theme is officially supported. Admonition styling and icons rely on Material theme CSS. Other themes may work but have not been tested.

Contributions to add support for other themes are welcome; see CONTRIBUTING.md. Material theme support is a requirement.

No breaking changes to Material theme compatibility are allowed.

MkDocs Admonitions

The WYSIWYG editor supports MkDocs admonition syntax (!!! note, !!! warning, etc.) in both modes:

  • Markdown mode: Type !!! note followed by indented content (4 spaces)
  • WYSIWYG mode: Admonitions render as styled callout boxes with a settings gear for type, collapsible toggle, placement, and more. Editing preserves the !!! syntax when saving.

Supported types: note, warning, danger, tip, hint, important, caution, error, attention, abstract, info, success, question, failure, bug, example, quote.

Collapsible admonitions (??? type) and HTML details tags (!!! details) are also supported.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_live_wysiwyg_plugin-0.3.11.tar.gz (6.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocs_live_wysiwyg_plugin-0.3.11-py3-none-any.whl (6.1 MB view details)

Uploaded Python 3

File details

Details for the file mkdocs_live_wysiwyg_plugin-0.3.11.tar.gz.

File metadata

File hashes

Hashes for mkdocs_live_wysiwyg_plugin-0.3.11.tar.gz
Algorithm Hash digest
SHA256 bd3520175563769ddba56df8d19334627318c5477d16e938d105abc95d28afed
MD5 72aaf35580d04491c6f6fec44dcdf239
BLAKE2b-256 f4f3756a753856809fd64917324134fd5165ef2ac2e234e3837dd2516c0316d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_live_wysiwyg_plugin-0.3.11.tar.gz:

Publisher: publish.yml on samrocketman/mkdocs-live-wysiwyg-plugin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mkdocs_live_wysiwyg_plugin-0.3.11-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_live_wysiwyg_plugin-0.3.11-py3-none-any.whl
Algorithm Hash digest
SHA256 deec854c1dca1a918e6ccfc6f611647ced32f1bb9e24809977f1046474721f59
MD5 d1eddf9356ff970c3c2cd06bce5bf04b
BLAKE2b-256 629c8461b5e786ffaa06924ab59eec26df2ed15d4a15d646dd509553e7e7aa7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_live_wysiwyg_plugin-0.3.11-py3-none-any.whl:

Publisher: publish.yml on samrocketman/mkdocs-live-wysiwyg-plugin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page