6} from "https://esm.town/v/postpostscript/valTownLogo";
7
8export default async function(req: Request): Promise<Response> {
9 const html = `
10 <html>
1export async function html(markdown: string) {
2 const [
3 { micromark },
15}
16
17export async function gfm(
18 markdown: string,
19 options?: {
24const BADGE_COLOR = "6855c3";
25
26export default async function(req: Request): Promise<Response> {
27 const reqURL = new URL(req.url);
28 if (reqURL.pathname === "/") {
54}
55
56async function getBadgeConfig(aspeUri: string, debug = false): Promise<BadgeConfig> {
57 const config: BadgeConfig = {
58 label: BADGE_LABEL,
77}
78
79async function processAspeUri(aspeUri: string) {
80 let aspeURI: AspeURI | LegacyAspeURI = parseAspeURI(aspeUri);
81 if (!aspeURI) {
1// SPDX-License-Identifier: 0BSD
2
3export function appendFragment(fragment: string, html: string) {
4 if (!fragment) return html;
5 let offset = Math.min(
4import { isSameDay } from "npm:date-fns";
5
6export default async function checkTodayWorkout() {
7 const data = await fetchPelotonWorkouts(
8 "3f5bf759bb65494d8b35d26ec72b7340",
5const KEY = import.meta.url.split("?")[0];
6
7export async function addComment(str) {
8 const comments = await blob.getJSON(KEY) as Array<string> ?? [];
9 comments.push(str);
11 await email({ text: "New Comment Alert!: " + str });
12}
13export async function getComments() {
14 return await blob.getJSON(KEY) as Array<string> ?? [];
15}
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI";
3
4export async function aqi(interval: Interval) {
5 const location = "brooklyn navy yard"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });
15`.trim();
16
17export default async function(req: Request): Promise<Response> {
18 return new Response(
19 appendFragment(
4const { author, name } = extractValInfo(import.meta.url);
5
6async function serveHtml(req: Request): Promise<Response> {
7 return new Response(
8 `
9 * @param val Define which val should open. Defaults to the root reference.
10 */
11export function modifyHtmlString(
12 bodyText: string,
13 { val, style }: { val?: ValRef; style?: string } = {},
40 * @param val Define which val should open
41 */
42export function modifyFetchHandler(
43 handler: RequestHandler,
44 { val, style }: { val?: ValRef; style?: string } = {},
A helper function to build a file's email
Simple functional CSS library for Val Town
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.