Skip to main content

Module code

Module code 

Source
Expand description

A fenced code block: a header naming the language, a copy button, and the highlighted source.

Code is a text-presentation widget, so it lives beside Language, DefaultHighlighter and [StyledStr] rather than in the root crate. That is what lets a component crate claim a fence — install a Hook<CodeConfig> — without depending on the aggregator.

Structs§

Code
View that renders syntax-highlighted code snippets.
CodeConfig
Everything a fenced code block is, before anything decides how to show it.
OnCopied
What runs after a block’s text has landed on the clipboard.

Functions§

code
Convenience constructor for creating a Code view inline.