You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+86-41Lines changed: 86 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,24 +10,46 @@
10
10
11
11
**A lightweight and flexible Java library with a native CLI to pretty-print directory structures - ideal for documentation, project overviews, or CLI tools.**
12
12
13
-
Supports various [options](#customization-options) to customize the directories scanning and rendering:
14
-
- Filtering & sorting files and folders
15
-
- Emojis as file icons 🎉
16
-
- Limit displayed children of a folder (fixed value or dynamically)
17
-
- Custom line extension (comment, file details, etc.)
18
-
- Compact directory chains
19
-
- Maximum scanning depth
20
-
- Various styles for tree rendering
21
-
22
-
> [!NOTE]
23
-
> JFileTreePrettyPrinter is perfect to explain your project structure!
24
-
> See <ahref="jfiletreeprettyprinter-examples/src/main/java/io/github/computerdaddyguy/jfiletreeprettyprinter/example/ProjectStructure.java">ProjectStructure.java</a> to read the code that generated the tree from the below picture.
25
-
26
13
<palign="center">
27
14
<img src="assets/project-structure.png" alt="JFileTreePrettyPrint project structure, using JFileTreePrettyPrint"/>
15
+
<i>JFileTreePrettyPrint project structure, using JFileTreePrettyPrint</i>
28
16
</p>
29
17
30
-
*[Why use JFileTreePrettyPrinter?](#why-use-jfiletreeprettyprinter)
18
+
### ⚙️ Options compatibility matrix
19
+
Supports various [options](#customization-options) to customize the directories scanning and rendering:
20
+
| Option | Description | Supported in CLI | Supported in Library API |
- 🙅 Is **dependency-free** (on runtime) and compatible with **Java 21+**.
42
+
- ⚙️ Choose between **Java lib** or **Native CLI** implementation.
43
+
44
+
45
+
# Project Information
46
+
* See [🆕CHANGELOG.md](CHANGELOG.md) for a list of released versions and detailed changes.
47
+
* See [🗺️ROADMAP.md](ROADMAP.md) to discover planned features and upcoming improvements.
48
+
* This project is licensed under the Apache License 2.0. See [⚖️LICENSE](LICENSE) for details.
49
+
* For any questions or feedback please open an issue on this repository, as detailed in [🤝CONTRIBUTING.md](CONTRIBUTING.md).
50
+
51
+
52
+
# Table of content
31
53
*[Java lib](#java-lib)
32
54
*[Requirements](#requirements)
33
55
*[Import dependency](#import-dependency)
@@ -36,15 +58,7 @@ Supports various [options](#customization-options) to customize the directories
36
58
*[Native CLI](#native-cli)
37
59
*[Download and install](#download-and-install)
38
60
*[Usage](#cli-usage)
39
-
*[Options](#cli-options)
40
-
*[Project Information](#project-information)
41
-
42
-
# Why use JFileTreePrettyPrinter?
43
-
Unlike a plain recursive `Files.walk()`, this library:
44
-
- Prints **visually appealing** directory trees.
45
-
- Allows **rich customization** (filters, sorts, emojis, compacting, tree style).
46
-
- Supports **dynamic child limits** and **custom extensions** per line.
47
-
- Is **dependency-free** (on runtime) and compatible with **Java 21+**.
61
+
*[Options](#cli-options)
48
62
49
63
# Java lib
50
64
@@ -95,12 +109,9 @@ base/
95
109
└─ landscape.jpeg
96
110
```
97
111
98
-
> [!NOTE]
99
-
> In case of error while reading directories or files, an [UncheckedIOException](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/UncheckedIOException.html) is thrown.
100
-
101
112
## Customization options
102
-
> [!NOTE]
103
-
> All code below is availabe in [jfiletreeprettyprinter-examples] submodule.(jfiletreeprettyprinter-examples\src\main\java\io\github\computerdaddyguy\jfiletreeprettyprinter\example)
113
+
> [!TIP]
114
+
> All code below is availabe in [jfiletreeprettyprinter-examples](jfiletreeprettyprinter-examples\src\main\java\io\github\computerdaddyguy\jfiletreeprettyprinter\example) submodule.
If the tree symbols appear as garbled characters (e.g., Ôöé instead of ├─), your console is likely not using UTF-8 encoding.
418
+
If the tree symbols appear as garbled characters (e.g., `Ôöé` instead of `├─`), your console is likely not using UTF-8 encoding.
408
419
409
420
**Set UTF-8 Encoding**
410
421
```
@@ -419,16 +430,18 @@ $ export LC_CTYPE=UTF-8
419
430
```
420
431
421
432
## CLI options
422
-
The native CLI supports (almost all) pretty print options through an external JSON or YAML configuration file provided as an argument.
423
-
424
-
This configuration file must comply with the [CLI options file schema](jfiletreeprettyprinter-cli/src/main/resources/schemas/jfiletreeprettyprinter-options.schema.json).
433
+
434
+
The native CLI supports **custom options** through an external JSON or YAML file provided with the `--options` (or `-o`) argument.
435
+
This options file must comply with the [CLI options file schema](jfiletreeprettyprinter-cli/src/main/resources/schemas/jfiletreeprettyprinter-options.schema.json).
436
+
437
+
> [!TIP]
438
+
> YAML is fully supported since it’s a superset of JSON, offering a more readable syntax.
> The term `glob` refers to the pattern syntax supported by [FileSystem.getPathMatcher(String)](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/nio/file/FileSystem.html#getPathMatcher(java.lang.String)).
447
497
448
-
* See [🆕CHANGELOG.md](CHANGELOG.md) for a list of released versions and detailed changes.
449
-
* See [🗺️ROADMAP.md](ROADMAP.md) to discover planned features and upcoming improvements.
450
-
* This project is licensed under the Apache License 2.0. See [⚖️LICENSE](LICENSE) for details.
451
-
* For any questions or feedback please open an issue on this repository, as detailed in [🤝CONTRIBUTING.md](CONTRIBUTING.md).
452
-
453
498
---
454
499
Made with ❤️ by [ComputerDaddyGuy](https://github.com/ComputerDaddyGuy)
0 commit comments