mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-14 18:51:04 +00:00
22 lines
577 B
TypeScript
22 lines
577 B
TypeScript
import { formatTerminalLink } from "./terminal-link.js";
|
|
|
|
function resolveDocsRoot(): string {
|
|
return "https://docs.openclaw.ai";
|
|
}
|
|
|
|
export function formatDocsLink(
|
|
path: string,
|
|
label?: string,
|
|
opts?: { fallback?: string; force?: boolean },
|
|
): string {
|
|
const trimmed = path.trim();
|
|
const docsRoot = resolveDocsRoot();
|
|
const url = trimmed.startsWith("http")
|
|
? trimmed
|
|
: `${docsRoot}${trimmed.startsWith("/") ? trimmed : `/${trimmed}`}`;
|
|
return formatTerminalLink(label ?? url, url, {
|
|
fallback: opts?.fallback ?? url,
|
|
force: opts?.force,
|
|
});
|
|
}
|