Class HxDialect

java.lang.Object
org.thymeleaf.dialect.AbstractDialect
org.thymeleaf.dialect.AbstractProcessorDialect
io.karatelabs.markup.HxDialect
All Implemented Interfaces:
org.thymeleaf.dialect.IDialect, org.thymeleaf.dialect.IProcessorDialect

public class HxDialect extends org.thymeleaf.dialect.AbstractProcessorDialect
Thymeleaf dialect for HTMX support. Provides processors for ka:get, ka:post, ka:put, ka:patch, ka:delete, ka:vals, ka:target, ka:swap, etc. These are converted to their hx-* equivalents during template processing.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new HxDialect with default configuration (no context path).
    Create a new HxDialect with the given markup configuration.
    HxDialect(String contextPath)
    Create a new HxDialect with the given context path.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the context path for this dialect.
    Set<org.thymeleaf.processor.IProcessor>
    getProcessors(String dialectPrefix)
     

    Methods inherited from class org.thymeleaf.dialect.AbstractProcessorDialect

    getDialectProcessorPrecedence, getPrefix

    Methods inherited from class org.thymeleaf.dialect.AbstractDialect

    getName

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.thymeleaf.dialect.IDialect

    getName
  • Constructor Details

    • HxDialect

      public HxDialect()
      Create a new HxDialect with default configuration (no context path).
    • HxDialect

      public HxDialect(MarkupConfig config)
      Create a new HxDialect with the given markup configuration.
      Parameters:
      config - the markup configuration (uses contextPath from it)
    • HxDialect

      public HxDialect(String contextPath)
      Create a new HxDialect with the given context path.
      Parameters:
      contextPath - the context path to prepend to HTMX URLs
  • Method Details

    • getContextPath

      public String getContextPath()
      Get the context path for this dialect.
      Returns:
      the context path (may be null)
    • getProcessors

      public Set<org.thymeleaf.processor.IProcessor> getProcessors(String dialectPrefix)