--- /dev/null
+build/
+__pycache__/
--- /dev/null
+main : .venv/touchfile
+ npx tsc
+ .venv/bin/flask --app director run --debug
+
+.venv/touchfile : requirements.txt
+ python3 -m venv .venv
+ .venv/bin/python -m pip install -r requirements.txt
+ touch .venv/touchfile
--- /dev/null
+from flask import Flask, render_template, send_from_directory
+import os
+
+app = Flask(__name__, instance_relative_config=False)
+app.config.from_mapping(
+ DATABASE=os.path.join(app.root_path, 'flaskr.sqlite')
+)
+
+@app.route("/", methods=['get'])
+def index():
+ return render_template("index.html")
+
+@app.route("/script/<path:filename>", methods=["get"])
+def script(filename):
+ return send_from_directory(os.path.join(app.root_path, "build"), filename)
--- /dev/null
+export default function renderTitle(): void {
+ const el: HTMLCollectionOf<Element> = document.getElementsByClassName("title");
+
+ for (let e of el) {
+ console.log(e);
+ }
+}
--- /dev/null
+import renderTitle from "./title.js";
+export {};
+
+function update(): void {
+ renderTitle();
+}
+
+update();
--- /dev/null
+<!doctype html>
+<html>
+ <head>
+ <script type="text/javascript" type="module" src="/script/update.js" defer></script>
+ </head>
+ <body>
+ <span class="update root__product__current-price"></span>
+ </body>
+</html>
--- /dev/null
+<html>
+ <head>
+ <title>Documentation</title>
+ </head>
+ <body>
+ <h1>Docs</h1>
+
+ <h2>Classes</h2>
+
+ <h3><code>update</code></h3>
+ <p>
+ generates the javascript to update the blocks <code>data-raw</code> attribute with the latest data from the websocket
+ </p>
+
+ <h3><code>root__[key]</code></h3>
+ <p>
+ e.g. <code>root__product__price</code><br>
+ generates the javascript to update the blocks <code>data-raw</code> attribute with the latest data from the websocket. when a block updates, all keys in that block (incl. other blocks) are all updated
+ </p>
+
+ <h3><code>timer</code></h3>
+ <p>
+ when postprocessing <code>data-raw</code>, it is interpreted as a unix timecode and is displayed as time till that unix timecode
+ </p>
+
+ <h3><code>title</code></h3>
+ <p>
+ when postprocessing <code>data-raw</code>, it is interpreted as text and put in title case
+ </p>
+
+ <h3><code></code></h3>
+ <p>
+ </p>
+ </body>
+</html>
--- /dev/null
+{
+ // Visit https://aka.ms/tsconfig to read more about this file
+ "include": ["./director/src"],
+ "compilerOptions": {
+ // File Layout
+ "rootDir": "./director/src",
+ "outDir": "./director/build",
+
+ // Environment Settings
+ // See also https://aka.ms/tsconfig/module
+ "module": "nodenext",
+ "target": "esnext",
+ "types": [],
+ // For nodejs:
+ // "lib": ["esnext"],
+ // "types": ["node"],
+ // and npm install -D @types/node
+
+ // Other Outputs
+ "sourceMap": true,
+ "declaration": true,
+ "declarationMap": true,
+
+ // Stricter Typechecking Options
+ "noUncheckedIndexedAccess": true,
+ "exactOptionalPropertyTypes": true,
+
+ // Style Options
+ // "noImplicitReturns": true,
+ // "noImplicitOverride": true,
+ // "noUnusedLocals": true,
+ // "noUnusedParameters": true,
+ // "noFallthroughCasesInSwitch": true,
+ // "noPropertyAccessFromIndexSignature": true,
+
+ // Recommended Options
+ "strict": true,
+ "jsx": "react-jsx",
+ "verbatimModuleSyntax": false,
+ "isolatedModules": true,
+ "noUncheckedSideEffectImports": true,
+ "moduleDetection": "force",
+ "skipLibCheck": true,
+ }
+}