Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
import { relative } from 'node:path';
import { isWithinDir, toPosix } from './path-utils.ts';
export function displayPathFor(abs: string, projectDir: string | null, home: string): string {
if (projectDir !== null && isWithinDir(abs, projectDir))
return toPosix(relative(projectDir, abs));
if (isWithinDir(abs, home)) return `~/${toPosix(relative(home, abs))}`;
return toPosix(abs);
}