@@ -41,22 +41,37 @@ children:
4141` ` ` bash
4242treemapper . # YAML to stdout
4343treemapper . -o tree.yaml # save to file
44+ treemapper . -o - # explicit stdout output
4445treemapper . --format json # JSON format
4546treemapper . --format text # tree-style text
4647treemapper . --no-content # structure only (no file contents)
4748treemapper . --max-depth 3 # limit directory depth
4849treemapper . --max-file-bytes 10000 # skip files larger than 10KB
4950treemapper . -i custom.ignore # custom ignore patterns
51+ treemapper . --no-default-ignores # disable .gitignore/.treemapperignore (custom -i still works)
52+ treemapper . -v 2 # verbose output (0=ERROR, 1=WARNING, 2=INFO, 3=DEBUG)
53+ treemapper --version # show version
5054```
5155
5256## Python API
5357
5458``` python
5559from treemapper import map_directory, to_yaml, to_json, to_text
5660
57- # Get tree as dict
61+ # Full function signature
62+ tree = map_directory(
63+ path, # directory path (str or Path)
64+ max_depth = None , # limit traversal depth
65+ no_content = False , # exclude file contents
66+ max_file_bytes = None , # skip files larger than N bytes
67+ ignore_file = None , # custom ignore file path
68+ no_default_ignores = False , # disable .gitignore/.treemapperignore
69+ )
70+
71+ # Examples
5872tree = map_directory(" ./myproject" )
5973tree = map_directory(" ./src" , max_depth = 2 , no_content = True )
74+ tree = map_directory(" ." , max_file_bytes = 50000 , ignore_file = " custom.ignore" )
6075
6176# Serialize to string
6277yaml_str = to_yaml(tree)
@@ -68,6 +83,20 @@ text_str = to_text(tree)
6883
6984Respects ` .gitignore ` and ` .treemapperignore ` automatically. Use ` --no-default-ignores ` to include everything.
7085
86+ Features:
87+ - Hierarchical: nested ` .gitignore ` /` .treemapperignore ` files work at each directory level
88+ - Negation patterns: ` !important.log ` un-ignores a file
89+ - Anchored patterns: ` /root_only.txt ` matches only in root, ` *.log ` matches everywhere
90+ - Output file is always auto-ignored (prevents recursive inclusion)
91+
92+ ## Content Placeholders
93+
94+ When file content cannot be read normally, placeholders are used:
95+ - ` <file too large: N bytes> ` — file exceeds ` --max-file-bytes ` limit
96+ - ` <binary file: N bytes> ` — file detected as binary (contains null bytes)
97+ - ` <unreadable content: not utf-8> ` — file is not valid UTF-8
98+ - ` <unreadable content> ` — file cannot be read (permission denied, I/O error)
99+
71100## Development
72101
73102``` bash
0 commit comments