diff --git a/src/components/ApiDocViewer.tsx b/src/components/ApiDocViewer.tsx index 73b7940..5f30ad5 100644 --- a/src/components/ApiDocViewer.tsx +++ b/src/components/ApiDocViewer.tsx @@ -71,7 +71,15 @@ export const ApiDocViewer = ({ onDocsPathChange, showAddModal, onCloseAddModal } setExternalDocs(docs) - const fileList = docs.map(d => d.relativePath) + const fileList = docs + .filter(doc => { + const parts = doc.relativePath.split('/') + if (parts.length < 2) return true + const filename = parts[parts.length - 1].replace(/\.md$/, '') + const parentFolder = parts[parts.length - 2] + return filename !== parentFolder + }) + .map(d => d.relativePath) const tree = buildFileTree(fileList, '/') setFileTree(tree)