Live Demo Playground
Experiment with the ProseMirror Completion plugin directly in the docs. The playground below lets you switch between different completion modes, including WebLLM-powered suggestions.
Scenarios Covered
- Plain Text – basic mock completions.
- Code Blocks – writing inside fenced code blocks yields code-oriented snippets.
- Markdown to Node – markdown strings are parsed via
prosemirror-markdownand inserted as nodes. - HTML – HTML strings are parsed and inserted with formatting.
- ProseMirror Node – returns schema-safe nodes directly.
- Custom Prompt – demonstrates prompt templating before calling
callCompletion. - WebLLM – browser LLM completions via
@mlc-ai/web-llm.
Note: WebLLM requires downloading a model (~100MB) at first use. Please wait for the status message to show “WebLLM ready” before typing.
Usage Tips
- Type at least 3 characters to trigger suggestions.
- Use Tab to accept and Esc to cancel.
- For the code mode, wrap your text in triple backticks (
```) to indicate a code block. - Markdown mode produces headings, lists, and blockquotes to showcase structured insertions.
- HTML mode is a quick way to preview rich text inserted by the plugin.
Troubleshooting
- If WebLLM fails to load, check the console for errors or retry; network connectivity is required.
- For best performance, keep a single demo instance active at a time.