Skip to content

Commit 85ee72b

Browse files
update README to clarify input rules and provide examples for correct and incorrect structures
1 parent 091f64a commit 85ee72b

1 file changed

Lines changed: 44 additions & 4 deletions

File tree

README.md

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,46 @@ node dist/cli.js --root . --infer-root --gitkeep --from tree.txt
5050
cat tree.txt | node dist/cli.js --root . --infer-root
5151
```
5252

53+
### Input rules (read carefully)
54+
55+
* **Do not add comments or annotations** in the structure. Only list directories and files.
56+
57+
* ❌ Don’t use trailing notes like `# ...` or `(optional ...)`.
58+
* **Directories must end with `/`** to be recognized as folders.
59+
* **Files** can have an extension (e.g. `index.ts`) **or not** (e.g. `Dockerfile`, `LICENSE`).
60+
61+
**Correct**
62+
63+
```
64+
example-api/
65+
├─ app/
66+
│ ├─ main.py
67+
│ ├─ core/
68+
│ │ ├─ settings.py
69+
│ │ └─ logging.py
70+
├─ Dockerfile
71+
└─ README.md
72+
```
73+
74+
**Incorrect**
75+
76+
```
77+
example-api/
78+
├─ app/
79+
│ ├─ main.py
80+
│ ├─ core/
81+
│ │ ├─ settings.py # global settings
82+
│ │ └─ logging.py # any other comments
83+
│ ├─ api/
84+
│ │ ├─ routers/
85+
│ │ │ ├─ users.py
86+
│ │ └─ errors.py
87+
│ └─ utils/
88+
│ └─ http.py
89+
├─ Dockerfile # optional
90+
└─ README.md
91+
```
92+
5393
Key options:
5494

5595
* `--root <dir>` output root directory, default `.`
@@ -76,14 +116,14 @@ my-project/
76116
README.md
77117
```
78118

79-
### 2) Box drawing characters with inline comments
119+
### 2) Box drawing characters
80120

81121
```
82122
example-api/
83123
├─ app/
84124
│ ├─ main.py
85125
│ ├─ core/
86-
│ │ ├─ settings.py # global settings
126+
│ │ ├─ settings.py
87127
│ │ └─ logging.py
88128
│ ├─ api/
89129
│ │ ├─ routers/
@@ -98,7 +138,7 @@ example-api/
98138
└─ README.md
99139
```
100140

101-
### 3) Web library with dotted folders and an optional playground
141+
### 3) Web library with dotted folders
102142

103143
```
104144
ui-library/
@@ -118,7 +158,7 @@ ui-library/
118158
tests/
119159
button.test.tsx
120160
.github/workflows/ci.yml
121-
examples/ (optional, playground with a bundler)
161+
examples/
122162
```
123163

124164
## Contributing

0 commit comments

Comments
 (0)