Raxol.Components.CodeBlock (Raxol v0.3.0)
View SourceRenders a block of code with syntax highlighting.
Requires the makeup_elixir
dependency (and potentially other lexers).
Uses HTML output from Makeup.
Summary
Functions
Callback implementation for Raxol.UI.Components.Base.Component.handle_event/3
.
Callback implementation for Raxol.UI.Components.Base.Component.init/1
.
Callback implementation for Raxol.UI.Components.Base.Component.mount/1
.
Renders the code block.
Callback implementation for Raxol.UI.Components.Base.Component.unmount/1
.
Callback implementation for Raxol.UI.Components.Base.Component.update/2
.
Functions
Callback implementation for Raxol.UI.Components.Base.Component.handle_event/3
.
Callback implementation for Raxol.UI.Components.Base.Component.init/1
.
Callback implementation for Raxol.UI.Components.Base.Component.mount/1
.
Renders the code block.
Props:
content
(required): The source code string.language
(required): The language name (e.g., "elixir", "html").style
: The Makeup HTML style module (e.g.,Makeup.Styles.GithubLight
). Defaults to:github_light
style lookup.class
: Optional CSS class for the outerpre
tag.
Callback implementation for Raxol.UI.Components.Base.Component.unmount/1
.
Callback implementation for Raxol.UI.Components.Base.Component.update/2
.