@k4a_l/dirtreeist 0.1.8 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -42
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
# DirTreeist
|
|
2
|
+
Create a directory Structure Diagram from a markdown lists.
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
## Example
|
|
5
|
+
### Input
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
```markdown
|
|
8
|
+
- /components
|
|
9
|
+
- App.tsx
|
|
10
|
+
- App.css
|
|
11
|
+
- config.json
|
|
12
|
+
- /utils
|
|
13
|
+
- converter.ts
|
|
14
|
+
- parser.ts
|
|
15
|
+
```
|
|
6
16
|
|
|
7
|
-
###
|
|
17
|
+
### Output
|
|
8
18
|
|
|
9
19
|
```text
|
|
10
20
|
├─/components
|
|
@@ -16,20 +26,9 @@
|
|
|
16
26
|
└─parser.ts
|
|
17
27
|
```
|
|
18
28
|
|
|
19
|
-
##
|
|
20
|
-
|
|
21
|
-
```ts
|
|
22
|
-
type DirNode = {
|
|
23
|
-
name: string
|
|
24
|
-
children: DirNode[]
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
type DirTree = DirNode[]
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## 使い方
|
|
29
|
+
## How to use
|
|
31
30
|
|
|
32
|
-
### TypeScript
|
|
31
|
+
### TypeScript
|
|
33
32
|
|
|
34
33
|
```ts
|
|
35
34
|
const markdown = `
|
|
@@ -65,7 +64,20 @@ const outputs = dirTrees.map((dirTree) => convert(dirTree, options)) // DirTree[
|
|
|
65
64
|
console.log(outputs)
|
|
66
65
|
```
|
|
67
66
|
|
|
68
|
-
|
|
67
|
+
### Type
|
|
68
|
+
|
|
69
|
+
#### Structure
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
type DirNode = {
|
|
73
|
+
name: string
|
|
74
|
+
children: DirNode[]
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
type DirTree = DirNode[]
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
#### Options
|
|
69
81
|
|
|
70
82
|
```ts
|
|
71
83
|
type Options = {
|
|
@@ -76,28 +88,13 @@ type Options = {
|
|
|
76
88
|
}
|
|
77
89
|
```
|
|
78
90
|
|
|
79
|
-
###
|
|
80
|
-
|
|
81
|
-
```shell
|
|
82
|
-
dirTreeist <inputFile> [...options]
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
#### オプション
|
|
86
|
-
|
|
87
|
-
```test
|
|
88
|
-
-t, --treeType ['normal'|'bold'|'ascii']
|
|
89
|
-
-e, --empty [boolean]
|
|
90
|
-
-space, --spaceBeforeName [boolean]
|
|
91
|
-
-size, --spaceSize [number]
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### オプションの説明
|
|
91
|
+
### Description of options
|
|
95
92
|
|
|
96
93
|
#### treeType
|
|
97
94
|
|
|
98
|
-
|
|
95
|
+
default:`normal`
|
|
99
96
|
|
|
100
|
-
normal
|
|
97
|
+
##### normal
|
|
101
98
|
|
|
102
99
|
```
|
|
103
100
|
│
|
|
@@ -106,7 +103,7 @@ normal
|
|
|
106
103
|
└─
|
|
107
104
|
```
|
|
108
105
|
|
|
109
|
-
bold
|
|
106
|
+
##### bold
|
|
110
107
|
|
|
111
108
|
```
|
|
112
109
|
┃
|
|
@@ -115,7 +112,7 @@ bold
|
|
|
115
112
|
┗━
|
|
116
113
|
```
|
|
117
114
|
|
|
118
|
-
ascii
|
|
115
|
+
##### ascii
|
|
119
116
|
|
|
120
117
|
```
|
|
121
118
|
|
|
|
@@ -126,7 +123,9 @@ ascii
|
|
|
126
123
|
|
|
127
124
|
#### emptyLineBeforeUpperHierarchy : boolean
|
|
128
125
|
|
|
129
|
-
|
|
126
|
+
default:`false`
|
|
127
|
+
|
|
128
|
+
##### true
|
|
130
129
|
|
|
131
130
|
```text
|
|
132
131
|
(true)
|
|
@@ -142,10 +141,11 @@ ascii
|
|
|
142
141
|
|
|
143
142
|
#### spaceBeforeName : boolean
|
|
144
143
|
|
|
145
|
-
|
|
144
|
+
default: `false`
|
|
145
|
+
|
|
146
|
+
##### true
|
|
146
147
|
|
|
147
148
|
```text
|
|
148
|
-
(true)
|
|
149
149
|
├─ /components
|
|
150
150
|
│ ├─ App.tsx
|
|
151
151
|
│ └─ App.css
|
|
@@ -157,10 +157,11 @@ ascii
|
|
|
157
157
|
|
|
158
158
|
#### spaceSize : number
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
default:`2`
|
|
161
|
+
|
|
162
|
+
##### 4
|
|
161
163
|
|
|
162
164
|
```text
|
|
163
|
-
(4)
|
|
164
165
|
├──/components
|
|
165
166
|
│ ├──App.tsx
|
|
166
167
|
│ └──App.css
|