A comprehensive guide to all available snippets in the EditorEngine
Waveslab Words includes a powerful editor engine with support for snippets that can be quickly inserted into your document. These snippets provide ready-made HTML components, layouts, and interactive elements to speed up your document creation.
To use a snippet:
Shift + Space
For more complex snippets, you may be prompted to provide additional information.
Snippet | Description | Example |
---|---|---|
div |
Creates a basic div element | <div contenteditable="true"></div> |
p |
Creates a paragraph element | <p contenteditable="true"></p> |
h1 to h6 |
Creates a heading element | <h1 contenteditable="true"></h1> |
a |
Creates a link | <a href="#" contenteditable="true">Link Text</a> |
img |
Inserts an image (will prompt for URL) | <img src="url" alt="Image" class="resizable-image" /> |
The editor supports Emmet-style shortcuts for quickly creating HTML structures.
Pattern | Description | Example |
---|---|---|
tag |
Creates a basic HTML element | div → <div></div> |
tag.class |
Element with class | div.container → <div class="container"></div> |
tag#id |
Element with ID | div#header → <div id="header"></div> |
tag.class1.class2 |
Element with multiple classes | div.btn.btn-primary → <div class="btn btn-primary"></div> |
parent>child |
Nested elements | div>p → <div><p></p></div> |
tag*n |
Multiple elements | li*3 → <li></li><li></li><li></li> |
parent>child*n |
Parent with multiple children | ul>li*3 → <ul><li></li><li></li><li></li></ul> |
tag{content} |
Element with text content | h1{Hello World} → <h1>Hello World</h1> |
tag[attr=value] |
Element with attributes | a[href=https://example.com] → <a href="https://example.com"></a> |
contenteditable="true"
to allow easy editingresizable-image
class, allowing you to resize them by draggingThe editor also includes several utility functions that can be used to manipulate content:
Function | Description |
---|---|
insertHTMLAtCursor(html) |
Inserts HTML content at the current cursor position |
createList(type, count) |
Creates an ordered or unordered list with the specified number of items |
createTable(rows, cols) |
Creates a table with the specified number of rows and columns |
createLink(className, id) |
Creates a link with optional class and ID attributes |
createInput(type) |
Creates an input field of the specified type |
insertImage() |
Opens a popup to insert an image at the cursor position |
undo() |
Undoes the last action |
redo() |
Redoes a previously undone action |
insertSnippet() |
Opens a popup to select and insert a predefined snippet |