$ show hmpl-language/hmpl
HMPL.js is a lightweight JavaScript library for server-oriented HTML templating. It compiles templates with block helpers (e.g., `{{#request ...}}`) into functions that fetch HTML from a server, sanitize it via DOMPurify, and render it into the DOM. The library supports indicators, memoization, intervals, and status binding, and uses JSON5 for expressive attribute parsing. The core is a single TypeScript module (`src/main.ts`) that exports `compile`, `stringify`, `createWarning`, and `createError`. The repository also contains a comprehensive documentation site built with Astro + Starlight (including Vue interactive components) and a Jekyll blog. The codebase is well-tested with Mocha, Sinon, nock, and jsdom, and has CI/CD via GitHub Actions. It is primarily a frontend library but includes robust build and test infrastructure.
The LLM identified 2 files worth highlighting for reuse:
A Vue component that renders a feature comparison table (e.g., HMPL.js vs Alpine vs HTMX). It uses sliders for mobile viewports and is fully self-contained with its own CSS and JavaScript. It can be extracted and reused in any Vue or Astro project for side-by-side comparisons of products or features.
An Astro component that injects JSON-LD structured data (WebSite, Organization, SoftwareApplication, FAQ) into page head. It is parameterized with schema-specific fields and can be reused across any Astro site to improve SEO with minimal configuration.