Bold
Mark selected text or the next typed characters as bold.
Bold adds the bold mark. Use it for text you want readers to spot, such as a new term or the key phrase in a release note.
Try it
Section titled “Try it”Install
Section titled “Install”cargo add gpdoc-plugin-boldExample
Section titled “Example”Register the bold formatter in the Quickstart editor configuration. bold() uses this formatter by default.
use gpdoc::{EditorConfig, PluginViewExt};use gpdoc_plugin_bold::{bold, bold_format};use gpdoc_plugin_paragraph::paragraph;
let config = EditorConfig::builder() .plugin(paragraph()) .plugin(bold().with_view(bold_format)) .build() .expect("configure editor");Type **release notes** in a paragraph. The editor removes the asterisks and displays release notes in bold.
Commands
Section titled “Commands”These commands take no arguments. Select text to change its formatting, or place the caret where you want to start typing. editor.run returns Result<CommandOutcome, Error>. A handled command returns Applied(AppliedChange). Set and toggle return NotApplicable if no text can take the mark.
setBold
Section titled “setBold”Apply bold to the selection or to the next characters typed at the caret.
editor.run(gpdoc_plugin_bold::Set)?;toggleBold
Section titled “toggleBold”Switch bold off when the whole eligible selection has the mark. On a mixed selection, apply it throughout.
editor.run(gpdoc_plugin_bold::Toggle)?;unsetBold
Section titled “unsetBold”Clear bold from the selection or turn it off for subsequent typing.
editor.run(gpdoc_plugin_bold::Unset)?;Keyboard shortcuts
Section titled “Keyboard shortcuts”Toggle bold with Command + B on macOS or Ctrl + B on Windows and Linux.
Typing **release notes** or __release notes__ applies bold.