DocumentTree

io.eleven19.ascribe.ast.DocumentTree
See theDocumentTree companion object
case class DocumentTree(root: TreeNode)

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.

Attributes

Companion
object
Source
DocumentTree.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

All documents in the tree as a flat list of (path, document) pairs.

All documents in the tree as a flat list of (path, document) pairs.

Attributes

Source
DocumentTree.scala
def collect[B](pf: PartialFunction[(DocumentPath, Document), B]): List[B]

Collect values from documents matching a partial function.

Collect values from documents matching a partial function.

Attributes

Source
DocumentTree.scala
def filter(pred: DocumentPath => Boolean): DocumentTree

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.

Attributes

Source
DocumentTree.scala
def get(path: DocumentPath): Option[Document]

Find a document by path.

Find a document by path.

Attributes

Source
DocumentTree.scala

Map a transformation over every document in the tree.

Map a transformation over every document in the tree.

Attributes

Source
DocumentTree.scala
def size: Int

Number of documents in the tree.

Number of documents in the tree.

Attributes

Source
DocumentTree.scala

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala