โ† Back to files/

Markdown Viewer   ๐Ÿฐ

๐Ÿงช Caddy Markdown Rendering โ€” Test Page

It works! If you're seeing styled HTML, Caddy's templates directive is live and converting .md โ†’ .html on the fly.


What's happening

Step Where
1. Request comes in for /test.md Caddy receives it
2. templates directive processes the file Built-in Go text/template + Markdown
3. Styled HTML sent to browser With syntax highlighting

Try it yourself

# Drop any .md file into /opt/data/shared/files/
echo "# Hello World" > /opt/data/shared/files/hello.md
# Visit https://shared.mostlydev.io/files/hello.md

Code highlighting

def uptime_summary():
    """Because everything's a spell if you squint."""
    return {
        "tower": "Hostinger VPS",
        "containers": 4,
        "status": "running (mostly)"
    }
"use client";

import * as React from "react";
import * as TooltipPrimitive from "@radix-ui/react-tooltip";

import { cn } from "@/utils/shadcn/utils";

type TooltipContentPointerDownOutsideHandler = NonNullable<
  React.ComponentPropsWithoutRef<
    typeof TooltipPrimitive.Content
  >["onPointerDownOutside"]
>;

type TooltipContextValue = {
  isTouchDevice: boolean;
  disableTouch: boolean;
  open: boolean;
  onOpenChange: (open: boolean) => void;
  triggerRef: React.RefObject<HTMLButtonElement | null>;
};

const TooltipContext = React.createContext<TooltipContextValue | null>(null);

// Radix ignores touch pointers when deciding to open a tooltip (hover-only by design), so on
// touch devices we drive open state ourselves: tap the trigger to open/close it explicitly.
function useIsTouchDevice() {
  const [isTouchDevice, setIsTouchDevice] = React.useState(false);

  React.useEffect(() => {
    const mediaQuery = window.matchMedia("(pointer: coarse)");
    setIsTouchDevice(mediaQuery.matches);

    const handleChange = (event: MediaQueryListEvent) =>
      setIsTouchDevice(event.matches);
    mediaQuery.addEventListener("change", handleChange);
    return () => mediaQuery.removeEventListener("change", handleChange);
  }, []);

  return isTouchDevice;
}

TooltipContent.displayName = TooltipPrimitive.Content.displayName;

const TooltipProvider = TooltipPrimitive.Provider;

export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };

Blockquote

"Honestly, I'm just happy to see it working."


Generated: 2026-09-16 ยท Served by Caddy via Traefik