Use Insert Code Block with 3 how-to topics, including inserting from the ribbon, inserting with slash commands, and adjusting code block settings; choose a topic from the index and follow the steps.
How-to Index
| No. | Topic | Membership Requirement |
|---|---|---|
| 1 | 1. Insert a code block from the ribbon | Free |
| 2 | 2. Insert a code block with slash commands | Free |
| 3 | 3. Adjust code block settings | Free |
How-to Guide
1. Insert a code block from the ribbon
Entry path: Insert > Code Block
- Place the cursor where you want to insert the code block.
- Click the Insert tab at the top of the window.
- Select Code Block.
- Type or paste your code into the inserted block.
Success Criteria
- Interface result: A separate code block appears in the document.
- Next action available: You can continue typing, pasting, or editing code inside the block.
Tips While Using
- Common mistake: If the cursor is not placed first, the code block may be inserted at the current default editing position.
- Environment note: You need to be in an editable smart document.
2. Insert a code block with slash commands
Entry path: Paragraph input > / > Code Block
- Type
/in a paragraph to open the quick menu. - Type
代码块orcodeto narrow the options. - Select the code block option.
- Enter your code in the new block.
Success Criteria
- Interface result: The quick menu inserts a new code block.
- Next action available: You can start entering code immediately without switching to another entry point.
Tips While Using
- Common mistake: If you stop after typing
/, too many options may appear and slow down selection.- Environment note: Use the command in an editable text area.
3. Adjust code block settings
Entry path: Code block toolbar > Language / Fixed Height / Settings
- Insert a code block first and select it.
- Click the language name at the top left of the code block to switch languages.
- Switch between Fixed Height and Fit Content as needed.
- Open Settings and turn Line Wrap on or off.
- In Settings, turn Dark Theme on or off.
Success Criteria
- Interface result: The selected language appears on the block, and the display updates based on your settings.
- Next action available: You can keep editing the code and refine the display for reading.
Tips While Using
- Common mistake: If the code block is not selected, the toolbar options may be less obvious.
- Environment note: These settings are available after a code block has been inserted.