dt-compiler

raw JSON →
0.2.1 verified Fri May 01 auth: no javascript abandoned

Δt dynamictemplate Compiler v0.2.1: a static HTML to Δt template compiler that automates separation of design (mockup HTML) and functionality. It compiles HTML masks that templates can use as selectors, ensuring template output matches the mockup structure. Requires dt-parser, dt-selector, and dynamictemplate as peer dependencies. Not actively developed; last release 2012. Differentiator: masks allow designer-driven updates without breaking templates, unlike manual template writing.

error Error: Cannot find module 'dt-parser'
cause Missing peer dependency dt-parser.
fix
npm install dt-parser@>=0.0.1
error Error: Cannot find module 'dt-selector'
cause Missing peer dependency dt-selector.
fix
npm install dt-selector@>=0.0.4
error Error: Cannot find module 'dynamictemplate'
cause Missing peer dependency dynamictemplate.
fix
npm install dynamictemplate@>=0.7.0
deprecated Package not updated since 2012; no support for modern Node.js or ES modules.
fix Consider alternatives like jsdom or cheerio for HTML transformation.
gotcha Mask matching is fragile: typo in class name causes duplicate content instead of error.
fix Double-check class names and selectors against the mockup.
gotcha Requires exact peer dependency versions; install may fail with npm v3+.
fix Use --legacy-peer-deps or install deps manually.
breaking No ESM support; all imports must be CommonJS require().
fix Use require() or a bundler that supports CJS.
npm install dt-compiler
yarn add dt-compiler
pnpm add dt-compiler

Compiles a mockup HTML file into a mask JavaScript file for use with dynamictemplate.

const { Compiler } = require('dt-compiler');

const compiler = new Compiler();
compiler.build({
  src: "index.html",
  dest: "body.js",
  select: function () { return this.select('body', '*') },
  done: function () { console.log("done."); process.exit(0); }
});