feat(docs): scan KB/ directory alongside docs/
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
d6eec4d240
commit
349647d4aa
1 changed files with 18 additions and 0 deletions
|
|
@ -22,6 +22,7 @@ type RepoDocInfo struct {
|
|||
ClaudeMd string
|
||||
Changelog string
|
||||
DocsFiles []string // All files in docs/ directory (recursive)
|
||||
KBFiles []string // All files in KB/ directory (recursive)
|
||||
}
|
||||
|
||||
func loadRegistry(registryPath string) (*repos.Registry, string, error) {
|
||||
|
|
@ -137,5 +138,22 @@ func scanRepoDocs(repo *repos.Repo) RepoDocInfo {
|
|||
})
|
||||
}
|
||||
|
||||
// Recursively scan KB/ directory for .md files
|
||||
kbDir := filepath.Join(repo.Path, "KB")
|
||||
if _, err := io.Local.List(kbDir); err == nil {
|
||||
_ = filepath.WalkDir(kbDir, func(path string, d fs.DirEntry, err error) error {
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
if d.IsDir() || !strings.HasSuffix(d.Name(), ".md") {
|
||||
return nil
|
||||
}
|
||||
relPath, _ := filepath.Rel(kbDir, path)
|
||||
info.KBFiles = append(info.KBFiles, relPath)
|
||||
info.HasDocs = true
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
return info
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue