server tools for HTMX

About

Jaxon is a server-side rendering tool for HTMX. It allows you to create dynamic HTML pages using JSON API's with HTMX.

How it works

Jaxon is a backend parser for JSON API's that allows you to create dynamic HTML pages for use with HTMX. It works by parsing JSON data into HTML elements and then returning the reuslt as raw HTML. It's a simple tool that allows you to create dynamic HTMX pages without the limitation of HTML rendered API's.

Usage

To format a JSON API you need to create a config for Jaxon as well as a URL for the target

Here's an example of a config for a JSON API:

<button hx-post="/jaxon.php" hx-include="#data, #link" hx-target="#res">post</button>
<input type="hidden" name="link" id="link" value="https://swapi.dev/api/people/1/?format=json">
<textarea hidden name="config" id="data" cols="30" rows="10">
    {
        "div": [
            {
                "h1": {
                    "text": "name"
                }
            },
            {
                "p": {
                    "text": "height"
                }
            },
            {
                "p": {
                    "text": "birth_year"
                }
            }
        ]
    }

</textarea>
<div id="res"></div>

Example

Here's an example of a JSON API being parsed using Jaxon:

Here's the config for the example (which is usually hidden):

This is the response HTML