Expand description
Source code for reading, from code.css.
A CodeBlock draws spans it is given. CodeSource::highlighted makes them with
upstream’s fc-highlight, the Rust twin of highlight.ts, so a block tokenizes the
same way on every renderer as it does in the browser; any other highlighter’s spans
work too. Every span sits in one <code>, so its text is byte-identical to the
source.
Re-exports§
pub use CodeBlock_completions::Component::CodeBlock;
Structs§
- Code
Block Props - Properties for the
CodeBlockcomponent. - Syntax
Span - A run of text sharing a role. Spans are contiguous and do not overlap.
Enums§
- Code
Layout - How a code block treats long lines.
- Code
Source - What a code block shows.
- Syntax
Role - A syntax role; each has a
--fc-code-<role>color.
Functions§
- Code
Block - A read-only block of source code.