This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main exposing (run) | |
import BackendTask | |
import BackendTask.File | |
import BackendTask.Glob | |
import Elm | |
import Elm.Annotation | |
import Pages.Script exposing (Script) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
customElements.define( | |
"custom-image", | |
class extends HTMLElement { | |
constructor() { | |
this.imgEl = document.createElement("img"); | |
this.appendChild(this.imgEl); | |
} | |
connectedCallback() { | |
this.render(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.customElements.define("elm-portal", class extends HTMLElement { | |
// Base custom element stuff | |
constructor() { | |
super(); | |
this._targetNode = document.createElement('div'); | |
} | |
connectedCallback() { | |
document.querySelector(this.getAttribute("data-target-selector")).appendChild(this._targetNode); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { basicSetup, EditorView } from "@codemirror/basic-setup"; | |
import { EditorState, Compartment, StateField } from "@codemirror/state"; | |
import { markdown } from "@codemirror/lang-markdown"; | |
customElements.define( | |
"markdown-editor", | |
class extends HTMLElement { | |
constructor() { | |
super(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { URL, pathToFileURL } from "url"; | |
import fs from "fs"; | |
import spawn from "cross-spawn"; | |
import { track } from "temp"; | |
import _ from "lodash"; | |
const temp = track(); | |
const baseURL = pathToFileURL(`${process.cwd()}/`).href; | |
// Elm files end in .elm. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
js="src/elm.js" | |
min="src/elm.min.js" | |
elm make --optimize --output=$js $@ | |
# change the cmpiled elm file to not immediately call the compiled function |