Skip to content

Commit 087a0de

Browse files
Doc for release
1 parent 632e382 commit 087a0de

File tree

3 files changed

+101
-47
lines changed

3 files changed

+101
-47
lines changed

CHANGELOG.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
---
9-
## [0.2.0] - 2025-11-12 - Native executable
9+
## [0.2.0] - 2025-11-13 - Native executable 🎉
1010

1111
> [!IMPORTANT]
1212
> Maven artifactId of Java lib changed from `jfiletreeprettyprinter` to `jfiletreeprettyprinter-core`
1313
1414
### Added
1515
- Run JFileTreePrettyPrinter in command line, using native executable on Windows, Linux, MacOS (see Github release attachments):
16-
`$ jfiletreeprettyprinter myFolder`
17-
- Scanning and rendering options in external file:
18-
`$ jfiletreeprettyprinter myFolder --options myOptions.json`
16+
```bash
17+
$ jfiletreeprettyprinter myFolder
18+
```
19+
- Supports options declared in external file:
20+
```bash
21+
$ jfiletreeprettyprinter myFolder --options myOptions.json
22+
```
23+
- 👉 More docs in [README](https://github.com/ComputerDaddyGuy/JFileTreePrettyPrinter#native-cli)
1924

2025
### Changed
2126
- Split code into 3 sub-modules: cli, core and examples

README.md

Lines changed: 86 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,46 @@
1010

1111
**A lightweight and flexible Java library with a native CLI to pretty-print directory structures - ideal for documentation, project overviews, or CLI tools.**
1212

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 <a href="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-
2613
<p align="center">
2714
<img src="assets/project-structure.png" alt="JFileTreePrettyPrint project structure, using JFileTreePrettyPrint"/>
15+
<i>JFileTreePrettyPrint project structure, using JFileTreePrettyPrint</i>
2816
</p>
2917

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 |
21+
|-----------------------------|--------------------------------------------------------------|--------------------|---------------------------|
22+
| `filter - dir` | Include/exclude specific directories | ✅ Yes | ✅ Yes |
23+
| `filter - file` | Include/exclude specific files | ✅ Yes | ✅ Yes |
24+
| `sorting` | Custom sorting of files/directories | ❌ No | ✅ Yes |
25+
| `emojis` | Display emojis as 📂 folders and 📄files icons | ✅ Yes | ✅ Yes |
26+
| `emoji - custom mapping` | Custom emoji mapping | ❌ No | ✅ Yes |
27+
| `compactDirectories` | Compact single-child directories into one line | ✅ Yes | ✅ Yes |
28+
| `childLimit - static` | Static limit number of displayed children per directory | ✅ Yes | ✅ Yes |
29+
| `childLimit - dynamic` | Dynamic limit number of displayed children per directory | ✅ Yes | ✅ Yes |
30+
| `maxDepth` | Maximum directory depth to display | ✅ Yes | ✅ Yes |
31+
| `lineExtensions` | Append custom strings/comments after matching paths | ✅ Yes | ✅ Yes |
32+
| `treeFormat` | Custom symbols for branches and indentation | ❌ No | ✅ Yes |
33+
| `external options file` | Use options defined in an external file | ✅ Yes | ❌ No |
34+
| `debug` | Print debug information to console | ✅ Yes (`--debug`) | ❌ No |
35+
36+
37+
# Why use JFileTreePrettyPrinter?
38+
Unlike a plain recursive `Files.walk()`, this library:
39+
- 📂 Prints **visually appealing** directory trees.
40+
- 🎨 Allows **rich customization** (filters, sorts, emojis, compacting, tree style).
41+
- 🙅 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
3153
* [Java lib](#java-lib)
3254
* [Requirements](#requirements)
3355
* [Import dependency](#import-dependency)
@@ -36,15 +58,7 @@ Supports various [options](#customization-options) to customize the directories
3658
* [Native CLI](#native-cli)
3759
* [Download and install](#download-and-install)
3860
* [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)
4862

4963
# Java lib
5064

@@ -95,12 +109,9 @@ base/
95109
└─ landscape.jpeg
96110
```
97111

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-
101112
## 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.
104115
105116
* [Filtering](#filtering)
106117
* [Sorting](#sorting)
@@ -404,7 +415,7 @@ Pretty-prints directory structure
404415
```
405416

406417
### UTF-8 console
407-
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.
408419

409420
**Set UTF-8 Encoding**
410421
```
@@ -419,16 +430,18 @@ $ export LC_CTYPE=UTF-8
419430
```
420431

421432
## 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.
439+
425440
```bash
426441
$ jfiletreeprettyprinter myFolder --options myOptions.json
427442
```
428443

429-
See an [example file](jfiletreeprettyprinter-examples/src/main/resources/cli/options/full-options.yaml).
430-
431-
### Options lookup order
444+
### 📋 Options lookup order
432445
If no options file is explicitly provided as argument, the CLI automatically searches for one in the following order:
433446
1. **Inside the target path:**
434447
A `.prettyprint` file located within the directory being printed.
@@ -443,12 +456,44 @@ equivalent to `PrettyPrintOptions.createDefault()`.
443456
> [!TIP]
444457
> Using a `.prettyprint` file allows each project or directory to define its own display style — no need to pass extra parameters each time.
445458
446-
# Project Information
459+
### 🧩 Example options file
460+
Below is an example configuration file that demonstrates commonly used options.
461+
It should be mostly self-explanatory:
462+
```yaml
463+
emojis: true
464+
maxDepth: 2
465+
compactDirectories: true
466+
childLimit:
467+
type: static
468+
limit: 3
469+
lineExtensions:
470+
- extension: " // Main entry point"
471+
matcher:
472+
type: name
473+
glob: "FileTreePrettyPrinter.java"
474+
filter:
475+
dir:
476+
type: name
477+
glob: "src/main/**"
478+
file:
479+
type: name
480+
glob: "*.java"
481+
```
482+
483+
### ⚠️ CLI Options limitations
484+
While the CLI offers broad configuration flexibility, not all features from the Java API are currently available.
485+
Refer to the [⚙️ Options Compatibility Matrix](#%EF%B8%8F-options-compatibility-matrix) at the top of this README for a complete overview.
486+
487+
**Path Matcher Support**
488+
The external options file supports a limited subset of matchers for defining filtering and selection logic:
489+
| Matcher type | Description | Example | Equivalent in `PathMatchers` Library API |
490+
|---------------------------|--------------------------------------------------------------------|--------------------|----------------------------------------------|
491+
| `name` | Matches folder or file name using a glob pattern | `*.java` | `hasNameMatchingGlob(String glob)` |
492+
| `path` | Matches a relative path (from the printed root) using a glob pattern| `src/main/java/**` | `hasRelativePathMatchingGlob(Path ref, String glob)` |
493+
| `allOf`, `anyOf`, `noneOf`| Composite matchers combining multiple matchers | n/a | `allOf(...)`, `anyOf(...)`, `noneOf(...)` |
494+
495+
> [!NOTE]
496+
> 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)).
447497

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-
453498
---
454499
Made with ❤️ by [ComputerDaddyGuy](https://github.com/ComputerDaddyGuy)

ROADMAP.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,13 @@
3737
## To do
3838
- [ ] Gather feedback
3939
- [ ] CLI: custom emojis mapping
40+
- [ ] CLI: more matchers
41+
- [ ] CLI: tree format
42+
- [ ] CLI: More documentation
43+
- [ ] CLI: optimize executable file size
4044

4145
## Backlog / To analyze / To implement if requested
42-
- [ ] Rework/fix Github wiki to be up to date
46+
- [ ] Complete documentation (Github pages? Github wiki?)
4347
- [ ] Refactor unit tests (custom assert?)
4448
- [ ] Option: Follow symlink
45-
- [ ] Automate image creation? Which API/service? (https://www.ray.so/)
49+
- [ ] Automate picture creation? Which API/service? (https://www.ray.so/)

0 commit comments

Comments
 (0)