WYSIWYG editor for mkdocs-live-edit-plugin based on @celsowm/markdown-wysiwyg
Project description
mkdocs-live-wysiwyg-plugin
This plugin is intended to be used by the techdocs-preview.sh shell script. It is assumed to be in your $PATH.
Try it out
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.
I modify GitHub documentation for this repository with the following command.
techdocs-preview.sh -c -a docs
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.
- ✅ Toggle-able checklists (task lists):
- ℹ️ 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.
Requirements
The following requirements are automatically managed by techdocs-preview.sh with uv.
- Python 3.10 or higher.
- mkdocs-live-edit-plugin (must
- mkdocs >= 1.5
Installation
If not using techdocs-preview.sh:
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
!!! notefollowed 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkdocs_live_wysiwyg_plugin-0.3.18.tar.gz.
File metadata
- Download URL: mkdocs_live_wysiwyg_plugin-0.3.18.tar.gz
- Upload date:
- Size: 6.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f431fabca3eda1dabf3161c154db16b2b2f3aaa362177e5f5c18f50716167c73
|
|
| MD5 |
8ed8c9ee27e148078350637630c68a77
|
|
| BLAKE2b-256 |
1a94810bdd2771cfaee8a247991366ddad08cb0e947a8f782c3a0c0934cef014
|
Provenance
The following attestation bundles were made for mkdocs_live_wysiwyg_plugin-0.3.18.tar.gz:
Publisher:
release.yml on samrocketman/mkdocs-live-wysiwyg-plugin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocs_live_wysiwyg_plugin-0.3.18.tar.gz -
Subject digest:
f431fabca3eda1dabf3161c154db16b2b2f3aaa362177e5f5c18f50716167c73 - Sigstore transparency entry: 1196216071
- Sigstore integration time:
-
Permalink:
samrocketman/mkdocs-live-wysiwyg-plugin@aab23a0cbcc5dc51175849c5bca4ed8237175d33 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/samrocketman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@aab23a0cbcc5dc51175849c5bca4ed8237175d33 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mkdocs_live_wysiwyg_plugin-0.3.18-py3-none-any.whl.
File metadata
- Download URL: mkdocs_live_wysiwyg_plugin-0.3.18-py3-none-any.whl
- Upload date:
- Size: 6.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
757442674e60510b0d752f2c90205e0f759513a5e208d1029c1dc9acca6255bd
|
|
| MD5 |
16b75bd70ff3f64153188a67d6acac12
|
|
| BLAKE2b-256 |
9d0795351b5c3b9ca0669d5781ee2b0f1b061cfb5ad3a1ebcd852736fb7a42c4
|
Provenance
The following attestation bundles were made for mkdocs_live_wysiwyg_plugin-0.3.18-py3-none-any.whl:
Publisher:
release.yml on samrocketman/mkdocs-live-wysiwyg-plugin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocs_live_wysiwyg_plugin-0.3.18-py3-none-any.whl -
Subject digest:
757442674e60510b0d752f2c90205e0f759513a5e208d1029c1dc9acca6255bd - Sigstore transparency entry: 1196216097
- Sigstore integration time:
-
Permalink:
samrocketman/mkdocs-live-wysiwyg-plugin@aab23a0cbcc5dc51175849c5bca4ed8237175d33 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/samrocketman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@aab23a0cbcc5dc51175849c5bca4ed8237175d33 -
Trigger Event:
push
-
Statement type: