Class Code
java.lang.Object
io.mindspice.simplypages.core.HtmlTag
io.mindspice.simplypages.components.Code
- All Implemented Interfaces:
Component
Inline/code-block renderer with optional language and title metadata.
Mutable and not thread-safe. For block mode, markup is assembled lazily during render. Mutate within a request-scoped flow. For reuse, stop mutating and render as a stable structure with per-request slot/context values.
-
Field Summary
Fields inherited from class HtmlTag
attributes, children, id, innerText, innerTextSlot, selfClosing, tagName, trustedHtml -
Method Summary
Modifier and TypeMethodDescriptionstatic CodeCreates a code block element.static CodeCreates an inline code element.render()Renders this component with an empty context.render(RenderContext context) Renders opening tag, text payload, child output, and closing tag.Alias forHtmlTag.addClass(String).withLanguage(String language) Sets the programming language for syntax highlighting.Adds a title/filename to display above the code block.Methods inherited from class HtmlTag
addClass, addStyle, addTrustedStyle, getChildrenStream, getId, hxDelete, hxGet, hxInclude, hxPatch, hxPost, hxPushUrl, hxPut, hxScrollTargetTop, hxSwap, hxTarget, hxTrigger, withAttribute, withChild, withId, withInnerText, withInnerText, withMaxWidth, withMinWidth, withUnsafeHtml, withWidth
-
Method Details
-
inline
-
block
-
withLanguage
-
withTitle
-
withClass
-
render
Description copied from class:HtmlTagRenders opening tag, text payload, child output, and closing tag.Security contract: slot and plain text are escaped; trusted HTML payload is emitted verbatim.
-
render
-