ismism/ui/bind/bind.ts
2024-08-19 13:49:13 +08:00

15 lines
512 B
TypeScript

import { mdh } from "../../src/doc/mdh.ts"
import { idnam, section } from "./section.ts"
const main = document.getElementById("main") as HTMLDivElement
async function tst(
t: "tst" | "s8" | string
) {
const md = await (await fetch(`/tst/${t}.md`)).text()
const idn = [11111, 12222, 13333].map(id => [id, `${id}`]) as [number, string][]
main.innerHTML = `<article>${mdh(md)}${idnam("联络员:", idn)}${section("简介:", md)}</article>`
}
tst(location.hash == "" ? "tst" : location.hash.substring(1))