Skip to main content

Module code

Module code 

Source
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§

CodeBlockProps
Properties for the CodeBlock component.
SyntaxSpan
A run of text sharing a role. Spans are contiguous and do not overlap.

Enums§

CodeLayout
How a code block treats long lines.
CodeSource
What a code block shows.
SyntaxRole
A syntax role; each has a --fc-code-<role> color.

Functions§

CodeBlock
A read-only block of source code.