All Projects → ArthurClemens → mithril-template-converter

ArthurClemens / mithril-template-converter

Licence: other
Mithril HTML to JavaScript converter

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Labels

Projects that are alternatives of or similar to mithril-template-converter

mithril-select
Custom Select Component for Mithril.js
Stars: ✭ 14 (-84.27%)
Mutual labels:  mithril
Lichobile
lichess.org mobile application
Stars: ✭ 1,043 (+1071.91%)
Mutual labels:  mithril
Awesome Mithril
A curated list of Mithril awesome
Stars: ✭ 155 (+74.16%)
Mutual labels:  mithril
Msx
JSX for Mithril.js 0.x
Stars: ✭ 370 (+315.73%)
Mutual labels:  mithril
Todomvc Mithril
TodoMVC app using Mithril.js with CoffeeScript and Brunch
Stars: ✭ 15 (-83.15%)
Mutual labels:  mithril
Mithril Query
Query mithril virtual dom for testing purposes
Stars: ✭ 105 (+17.98%)
Mutual labels:  mithril
mithril-materialized
A Materialize-css library for the Mithril framework.
Stars: ✭ 22 (-75.28%)
Mutual labels:  mithril
Mithril Node Render
Use mithril views to render server side
Stars: ✭ 195 (+119.1%)
Mutual labels:  mithril
Bell
⏱ Counting down to the next time the bell rings at school
Stars: ✭ 15 (-83.15%)
Mutual labels:  mithril
Dnjs
DOM Notation JS
Stars: ✭ 118 (+32.58%)
Mutual labels:  mithril
Tutanota
Tutanota is an email service with a strong focus on security and privacy that lets you encrypt emails, contacts and calendar entries on all your devices.
Stars: ✭ 4,326 (+4760.67%)
Mutual labels:  mithril
Mithril Data
A rich data model library for Mithril javascript framework
Stars: ✭ 17 (-80.9%)
Mutual labels:  mithril
Mithril Isomorphic Example
Example of an isomorphic mithril application
Stars: ✭ 107 (+20.22%)
Mutual labels:  mithril
create-mithril-app
Sets up a mithril.js project with webpack
Stars: ✭ 20 (-77.53%)
Mutual labels:  mithril
Mithril Hx
Haxe externs for Mithril (JS MVC framework)
Stars: ✭ 178 (+100%)
Mutual labels:  mithril
pingcrm-mithril
Ping CRM on Mithril.js - A mithril demo application to illustrate how Inertia.js works.
Stars: ✭ 22 (-75.28%)
Mutual labels:  mithril
Mithril Infinite
Infinite scroll for Mithril
Stars: ✭ 83 (-6.74%)
Mutual labels:  mithril
Construct Ui
A Mithril.js UI library
Stars: ✭ 233 (+161.8%)
Mutual labels:  mithril
Mithril.js
A JavaScript Framework for Building Brilliant Applications
Stars: ✭ 13,062 (+14576.4%)
Mutual labels:  mithril
Crucible
API CMS UI powered by Firebase, mithril, and my own dwindling sanity. Oh, and acronyms.
Stars: ✭ 116 (+30.34%)
Mutual labels:  mithril

Mithril HTML to JavaScript converter

Online converter

Open online converter

Template Builder

Helper function to create Mithril templates from HTML. Use the output text to copy-paste into your source code.

/**
 * @param {object} opts 
 * @param {string} opts.source - String containing HTML markup
 * @param {("2" | "4" | "tab")} opts.indent - Indent spacing
 * @param {("double" | "single")} opts.quotes - Quotes
 * @param {("attributes" | "selectors")} opts.attrs - Display of attributes
 * @returns {string}
 */
const resultString = templateBuilder(opts)

Usage in modules

import { templateBuilder } from "mithril-template-builder"

const source = `
<p>Mithril website: <a href="http://mithril.js.org">Mithril website</a></p>
`
const output = templateBuilder({
  source
})

Output:

m("p",
  [
    "Mithril website: ",
    m("a", {"href":"http://mithril.js.org"}, 
      "Mithril website"
    )
  ]
)
import { templateBuilder } from "mithril-template-builder"

const source = `
<a href="http://mithril.js.org">Mithril</a>
`
const output = templateBuilder({
  source,
  indent: "4",
  attrs: "selectors",
  quotes: "single",
})

Output:

m('a[href="http://mithril.js.org"]', 
    'Mithril'
)

App

Contains source code for the online converter.

Helper patterns and libraries:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].