// The plugins that run in a browser, shared by the static pages and the playground so both render alike: the preset, // so the site shows what it gives. comark-include reads files and comark-linter is a checker, so they're left out, and // the preset's cast, table, tests, and bundle read no files, which a browser doesn't have. import comarkUi from "../packages/ui/src/html.ts"; import type { IconOptions } from "comark-icon"; import { avatars } from "./avatars.ts"; import type { PlayConfig } from "./config.ts"; // Google's favicon service has none for this site, which only declares an SVG icon, so its chips would look like code. const favicon = (host: string) => host === "comark-ui.onmax.me" ? "https://comark-ui.onmax.me/favicon.svg" : `https://www.google.com/s2/favicons?domain=${encodeURIComponent(host)}&sz=64`; // `download` is off in a browser, which may not download another site's images, so the reader's loads them as links. export const browserPlugins = ( config: PlayConfig = {}, { download = true, icon, typeset, }: { download?: boolean; icon?: IconOptions; typeset?: boolean } = {}, ) => comarkUi({ typeset, badge: { download }, chips: { download, favicon }, icon, code: config["comark-code"], comments: { avatars }, github: config["comark-github"], links: config["comark-links"], time: config["comark-time"], zoom: config["comark-zoom"], }).plugins; export const { components } = comarkUi();