A tree of AsciiDoc documents, modeling a directory of .adoc files.
Inspired by Laika's DocumentTree concept but using our AST types. All operations are pure — effectful variants live in the pipeline module.
Note: fromDocuments produces a flat tree (all documents as direct children of root) regardless of path depth. The DocumentPath on each leaf carries the full path, but the tree structure is not nested. Hierarchical grouping by directory is a future enhancement.
Filter documents, keeping only those whose path satisfies the predicate. Branches with no remaining children are pruned. If the root itself is filtered out, returns DocumentTree.empty.
Filter documents, keeping only those whose path satisfies the predicate. Branches with no remaining children are pruned. If the root itself is filtered out, returns DocumentTree.empty.