DocumentTree macro

Back to Available macros

The DocumentTree macro generates a hierarhical, alphabetically ordered list of the documents in the document tree, using a given document as the root document. This ordered list is enclosed in a <div> block, so that the list elements can be styled using CSS.

Properties

Output expansion default

Enabled.

Parameters

Ignored.

Variables

DocumentTree.class_name
The name of the html-class to give to the <div> tag. The html-class allows to style the generated list using CSS. Default DocumentTree.
DocumentTree.exclude
A list of tag-name/glob pairs (e.g. file_name *.txt), one per row, where the glob decides whether a given document with a given tag-value is to be excluded from the list. Default empty (matches nothing).
DocumentTree.exclude_regex
A list of tag-name/regex pairs (e.g. file_name .*.txt), one per row, where the regex decides whether a given document with a given tag-value is to be excluded from the list. Default empty (matches nothing).
DocumentTree.root_document
The document to use as the root node. Default DocumentTree_Macro.txt (expanded).
DocumentTree.include
A list of tag-name/glob pairs (e.g. file_name *.txt), one per row, where the glob decides whether a given document with a given tag-value is to be included in the list. Default file_name * (matches everything).
DocumentTree.include_regex
A list of tag-name/regex pairs (e.g. file_name .*.txt), one per row, where the regex decides whether a given document with a given tag-value is to be included in the list. Default empty (matches nothing).
DocumentTree.max_depth
Maximum depth for a document to be listed. Default 10.
DocumentTree.min_depth
Minimum depth for a document to be listed. Default 1 (i.e. the root-document is not listed).
DocumentTree.compact
An integer specifying whether to use a compact representation for the tree (non-zero), or not (zero). Default 1.

Notes

When specifying patterns, multiple rows are interpreted as alternatives. Possible surrounding whitespace is stripped off for each line. If both a regex pattern and a glob pattern is given, they are combined as alternatives.

A document is said to match when

Non-compact representation

In the non-compact representation, a document is listed if and only if

This preserves the parent-child relation between documents.

Compact representation

In the compact representation, a document is listed if and only if

This preserves the ancestor-descendant relation between documents, but not necessarily the parent-child relation.

Examples

[[set_many DocumentTree]]:
    root_document remark.txt
    compact 0
    min_depth 0
    include file_name *Tree*
[[DocumentTree]]
[[set_many DocumentTree]]:
    root_document remark.txt
    compact 1
    min_depth 0
    include file_name *Tree*
[[DocumentTree]]

See also

Pattern matching

Files

DocumentTree macro

Generates a hierarchical link-tree of the document-tree.