Class SyntaxHighlighterPrism

All Implemented Interfaces:
AttachNotifier, DetachNotifier, HasElement, HasSize, HasStyle, Serializable

@NpmPackage(value="react-syntax-highlighter", version="npm:@fengkx/react-syntax-highlighter@15.6.1") @JsModule("./react-syntax-highlighter-prism.tsx") @Tag("syntax-highlighter-prism") public class SyntaxHighlighterPrism extends BaseSyntaxHighlighter
A Vaadin component that wraps the react-syntax-highlighter library to provide syntax highlighting for code snippets. This implementation is based on Prism.js (more information here: https://github.com/react-syntax-highlighter/react-syntax-highlighter?tab=readme-ov-file#prism)
Since:
1.0.0
Author:
mlopezFC
See Also:
  • Constructor Details

    • SyntaxHighlighterPrism

      public SyntaxHighlighterPrism()
      Constructs a new SyntaxHighlighter for Java language with empty content
    • SyntaxHighlighterPrism

      public SyntaxHighlighterPrism(ShLanguagePrism language, String content)
      Constructs a new SyntaxHighlighter with the specified language and content using a11yDark theme.
      Parameters:
      language - The programming language to highlight.
      content - The code content to highlight.
  • Method Details

    • getShLanguage

      public ShLanguagePrism getShLanguage()
      Obtains the current SyntaxHighlighterPrism Language
      Returns:
    • setShLanguage

      public void setShLanguage(ShLanguagePrism language)
      Sets the SyntaxHighlighterPrism Language
      Parameters:
      language -
    • getShStyle

      public ShStylePrism getShStyle()
      Obtains the current SyntaxHighlighterPrism Style
      Returns:
    • setShStyle

      public void setShStyle(ShStylePrism style)
      Sets the SyntaxHighlighter Style
      Parameters:
      style -