wdpr
    Preparing search index...

    Module @wdprlib/runtime

    @wdprlib/runtime

    Client-side runtime for interactive Wikidot elements.

    bun add @wdprlib/runtime
    
    import { initWdprRuntime } from "@wdprlib/runtime";
    import type { WdprRuntime, RuntimeOptions } from "@wdprlib/runtime";

    // Initialize after DOM is ready
    const runtime: WdprRuntime = initWdprRuntime({
    root: document.getElementById("page-content") as HTMLElement,
    onRate: async (pageId, points) => {
    const res = await fetch("/api/rate", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ page_id: pageId, points }),
    });
    return res.json();
    },
    });

    // Cleanup when navigating away or re-rendering
    runtime.destroy();
    • Tabview tab switching
    • Collapsible block toggle
    • Table of contents navigation
    • Footnote / bibliography interactions
    • Foldable list toggle
    • Math rendering (MathML with SVG polyfill via hfmath)
    • Rating module callbacks
    • Date formatting (odate)
    • Email obfuscation reveal

    AGPL-3.0 - See LICENSE

    Modules

    bibcite
    collapsible
    email
    foldable-list
    footnote
    html-block
    index
    math
    modules/join
    modules/rate
    odate
    tabview
    toc
    types
    utils/dom
    utils/scroll
    utils/tooltip