Raxol. UI. Components. CodeBlock
(Raxol v2.6.0)
View Source
Renders a block of code with syntax highlighting.
Uses Makeup for tokenization when available, with graceful fallback to plain text when Makeup is not loaded.
Summary
Functions
Handles events for the component. No events are handled by default.
Initializes the component state from props.
Mount hook - called when component is mounted. No special setup needed for CodeBlock.
Renders the code block.
Unmount hook - called when component is unmounted. No cleanup needed for CodeBlock.
Updates the component state. No updates are handled by default.
Functions
Handles events for the component. No events are handled by default.
Initializes the component state from props.
Mount hook - called when component is mounted. No special setup needed for CodeBlock.
Renders the code block.
Props:
content(required): The source code string.language(optional): The language name (e.g., "elixir"). Defaults to "text".
Unmount hook - called when component is unmounted. No cleanup needed for CodeBlock.
Updates the component state. No updates are handled by default.