Skip to content
Trees
Github.com

Trees (Project Structure)

Display a directory tree / project structure in a clean "file explorer" card. Void gives tree code blocks a glassy, monospace treatment with subtly dimmed comments.

Basic usage

Wrap the tree in a tree fenced code block:

mkdocs-void/
β”œβ”€β”€ void/                          # Python package
β”‚   β”œβ”€β”€ __init__.py                  # Version (0.2.0)
β”‚   β”œβ”€β”€ templates/
β”‚   β”‚   β”œβ”€β”€ base.html
β”‚   β”‚   β”œβ”€β”€ main.html
β”‚   β”‚   └── partials/
β”‚   β”‚       β”œβ”€β”€ header.html
β”‚   β”‚       └── toc.html
β”‚   └── plugins/
β”‚       └── void_plugin.py         # MkDocs plugin
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ index.md
β”‚   └── components/
β”œβ”€β”€ mkdocs.yml
└── requirements.txt
```tree
mkdocs-void/
β”œβ”€β”€ void/                          # Python package
β”‚   β”œβ”€β”€ __init__.py                  # Version (0.2.0)
...
```

Features

  • Box-drawing support β€” β”œβ”€β”€, └──, β”‚ glyphs render crisply in a monospace font.
  • Dimmed comments β€” trailing # comments are shown in muted italic so they don't fight the tree lines.
  • File-explorer card β€” each tree is wrapped in a subtle glass panel with rounded corners.
  • Scrollable β€” long trees scroll horizontally instead of wrapping.

Aligning comments

Pipe characters and spaces keep columns aligned. Use a monospace source editor; Void renders 1:1 with white-space: pre.

src/
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ engine.py        # entry point
β”‚   └── parser.py        # tokenizer
└── ui/
    β”œβ”€β”€ app.js           # main view
    └── styles.js        # tokens

Customizing

Override the card background/border by targeting the tree block in a custom stylesheet:

/* extra.css */
.highlight.language-tree {
  background: rgba(255, 255, 0, 0.04);
  border-color: var(--void-accent);
}

Trees pair well with the Code Highlighting and Admonitions components. See CSS Classes in Markdown to attach your own classes.