/jixen

jixen is a pre-processor for JavaScript which converts inline HTML expressions into actual JavaScript code which when executed will return the HTML element using the DOM API.

Primary LanguagePythonMIT LicenseMIT

jixen

jixen is a pre-processor for JavaScript which converts inline HTML expressions into actual JavaScript code which when executed will return the HTML element using the DOM API.

State-of-the-art Shitcode

Usage

Install dependencies using pip

pip install -r requirements.txt

Run jixen on your code

python jixen in.js out.js

Examples

Input:

const v = `<button onclick={console.log('Hello')}>"Hello"</button>`
document.body.append(v)

Output:

const v = (() => {
  let e = document.createElement('button')
  e.append('Hello')
  e.addEventListener('click', () => {
    console.log('Hello')
  })
  return e
})()
document.body.append(v)

Documentation

see ~/DOCS.md