Skip to content

Commit 8392ef2

Browse files
Feature/custom emojis option (#11)
1 parent 0391c67 commit 8392ef2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+935
-314
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
---
99
## [0.0.6] - Unreleased
1010

11+
### Added
12+
- Emojis: option to use custom mapping
13+
1114
### Changed
1215
- Child limit: do not print skipped children count
1316
- Max depth: do not print "max depth reached"

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,13 @@ sorting/
167167
```
168168

169169
## Emojis ❤️
170-
If your terminal supports them, you can choose to use emojis.
170+
You can choose to use default built-in emojis, or define your own emoji mapping.
171171
Folders use the 📂 emoji, and files will have an emoji depending on their extension (when applicable).
172172

173173
```java
174174
// Example: Emojis.java
175175
var prettyPrinter = FileTreePrettyPrinter.builder()
176-
.customizeOptions(options -> options.withEmojis(true))
176+
.customizeOptions(options -> options.withDefaultEmojis()) // or withEmojis(EmojiMapping) for custom mapping
177177
.build();
178178
```
179179

@@ -194,9 +194,6 @@ var prettyPrinter = FileTreePrettyPrinter.builder()
194194
└─ 🎬 file.avi
195195
```
196196

197-
> [!TIP]
198-
> *Idea for a future version: option to allow custom emoji mapping*
199-
200197
## Child limit
201198
You can set a fixed limit to the number of children displayed for each directory. Each directory and file that pass the filter (if set) counts for one.
202199

ROADMAP.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- [x] Option: filtering
66
- [x] Option: ordering
77
- [x] Option: emojis
8+
- [x] Option: custom emojis mapping
89
- [x] Option: compact directories display
910
- [x] Option: line extension (=additional text after the file name)
1011
- [x] Option: children limit (static & dynamic)
@@ -31,8 +32,6 @@
3132
- [x] Publish on Maven Central!
3233

3334
## To do
34-
- [ ] Option: hide number of skipped files and folders for child limit
35-
- [ ] Option: custom emojis
3635
- [ ] Option: custom tree format
3736

3837
## Backlog / To analyze / To implement if requested

assets/project-structure.png

14.7 KB
Loading

src/example/java/io/github/computerdaddyguy/jfiletreeprettyprinter/example/Emojis.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class Emojis {
66

77
public static void main(String[] args) {
88
var prettyPrinter = FileTreePrettyPrinter.builder()
9-
.customizeOptions(options -> options.withEmojis(true))
9+
.customizeOptions(options -> options.withDefaultEmojis()) // or withEmojis(EmojiMapping) for custom mapping
1010
.build();
1111
var tree = prettyPrinter.prettyPrint("src/example/resources/emojis");
1212
System.out.println(tree);

src/example/java/io/github/computerdaddyguy/jfiletreeprettyprinter/example/ProjectStructure.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public static void main(String[] args) {
8787
var prettyPrinter = FileTreePrettyPrinter.builder()
8888
.customizeOptions(
8989
options -> options
90-
.withEmojis(true) // Use emojis!
90+
.withDefaultEmojis() // Use emojis!
9191
.withCompactDirectories(true) // Inline directory chains: "src/main/java/..."
9292
.filterDirectories(dirFilter)
9393
.filterFiles(fileFilter)

0 commit comments

Comments
 (0)