(pages, backlinks)
| 445 | |
| 446 | |
| 447 | def find_orphans(pages, backlinks): |
| 448 | out = [] |
| 449 | for p in pages: |
| 450 | # 跳过根索引(它本身是最顶层) |
| 451 | if p.path == "wiki/root_index.md": |
| 452 | continue |
| 453 | # deprecated 页面没人引用是天经地义的(已被废弃),不算孤儿 |
| 454 | if p.status == "deprecated": |
| 455 | continue |
| 456 | if p.path not in backlinks or len(backlinks[p.path]) == 0: |
| 457 | out.append(p) |
| 458 | return out |
| 459 | |
| 460 | |
| 461 | def find_conflicts(pages): |
no outgoing calls
no test coverage detected