Skip to content

Commit fc767e7

Browse files
authored
Merge pull request #430 from DannyBen/update/render-templates
Update mandoc and markdown templates and examples
2 parents 711194d + 68b0591 commit fc767e7

File tree

84 files changed

+964
-692
lines changed

Some content is hidden

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

84 files changed

+964
-692
lines changed

examples/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ Each of these examples demonstrates one aspect or feature of bashly.
6969
## Documentation generation
7070

7171
- [render-mandoc](render-mandoc#readme) - auto-generate man pages for your script
72+
- [render-markdown](render-markdown#readme) - auto-generate markdown documentation for your script
7273

7374
## Other examples
7475

examples/catch-all-advanced/README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $ bashly generate
1515

1616
## `bashly.yml`
1717

18-
```yaml
18+
````yaml
1919
name: cli
2020
help: Sample application
2121
version: 0.1.0
@@ -58,15 +58,15 @@ commands:
5858
label: Files
5959
help: Files to upload
6060
required: true
61-
```
61+
````
6262

6363

6464

65-
## Generated script output
65+
## Output
6666

6767
### `$ ./cli`
6868

69-
```shell
69+
````shell
7070
cli - Sample application
7171

7272
Usage:
@@ -80,11 +80,11 @@ Commands:
8080

8181

8282

83-
```
83+
````
8484

8585
### `$ ./cli download -h`
8686

87-
```shell
87+
````shell
8888
cli download - Download a file
8989

9090
Alias: d
@@ -116,23 +116,23 @@ Examples:
116116

117117

118118

119-
```
119+
````
120120

121121
### `$ ./cli download source`
122122

123-
```shell
123+
````shell
124124
# this file is located in 'src/download_command.sh'
125125
# code for 'cli download' goes here
126126
# you can edit it freely and regenerate (it will not be overwritten)
127127
args:
128128
- ${args[source]} = source
129129

130130

131-
```
131+
````
132132

133133
### `$ ./cli download source target`
134134

135-
```shell
135+
````shell
136136
# this file is located in 'src/download_command.sh'
137137
# code for 'cli download' goes here
138138
# you can edit it freely and regenerate (it will not be overwritten)
@@ -141,11 +141,11 @@ args:
141141
- ${args[target]} = target
142142

143143

144-
```
144+
````
145145

146146
### `$ ./cli download source target and --additional stuff`
147147

148-
```shell
148+
````shell
149149
# this file is located in 'src/download_command.sh'
150150
# code for 'cli download' goes here
151151
# you can edit it freely and regenerate (it will not be overwritten)
@@ -160,11 +160,11 @@ other_args:
160160
- ${other_args[2]} = stuff
161161

162162

163-
```
163+
````
164164

165165
### `$ ./cli upload -h`
166166

167-
```shell
167+
````shell
168168
cli upload - Upload a file
169169

170170
Alias: u
@@ -183,20 +183,20 @@ Arguments:
183183

184184

185185

186-
```
186+
````
187187

188188
### `$ ./cli upload`
189189

190-
```shell
190+
````shell
191191
missing required argument: FILES...
192192
usage: cli upload FILES...
193193

194194

195-
```
195+
````
196196

197197
### `$ ./cli upload file1 "file 2" file3`
198198

199-
```shell
199+
````shell
200200
# this file is located in 'src/upload_command.sh'
201201
# code for 'cli upload' goes here
202202
# you can edit it freely and regenerate (it will not be overwritten)
@@ -209,7 +209,7 @@ other_args:
209209
- ${other_args[2]} = file3
210210

211211

212-
```
212+
````
213213

214214

215215

examples/catch-all-stdin/README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ $ bashly generate
1717

1818
## `bashly.yml`
1919

20-
```yaml
20+
````yaml
2121
name: cli
2222
help: Sample application
2323
version: 0.1.0
@@ -39,11 +39,11 @@ examples:
3939
- cli --format csv file1 file2
4040
- cat file1 | cli --format csv
4141
- cat file* | cli - --format csv
42-
```
42+
````
4343

4444
## `src/root_command.sh`
4545

46-
```bash
46+
````bash
4747
inspect_args
4848

4949
# Read contents of the provided file(s)
@@ -63,14 +63,14 @@ echo "collected file contents:"
6363
echo "$content"
6464
echo
6565

66-
```
66+
````
6767

6868

69-
## Generated script output
69+
## Output
7070

7171
### `$ ./cli -h`
7272

73-
```shell
73+
````shell
7474
cli - Sample application
7575

7676
Usage:
@@ -102,11 +102,11 @@ Examples:
102102

103103

104104

105-
```
105+
````
106106

107107
### `$ ./cli file1 file2 --format csv`
108108

109-
```shell
109+
````shell
110110
args:
111111
- ${args[--format]} = csv
112112

@@ -122,11 +122,11 @@ file2 content
122122

123123

124124

125-
```
125+
````
126126

127127
### `$ ./cli -f=csv file1 file2`
128128

129-
```shell
129+
````shell
130130
args:
131131
- ${args[--format]} = csv
132132

@@ -142,11 +142,11 @@ file2 content
142142

143143

144144

145-
```
145+
````
146146

147147
### `$ cat file1 | ./cli --format csv`
148148

149-
```shell
149+
````shell
150150
args:
151151
- ${args[--format]} = csv
152152

@@ -155,11 +155,11 @@ file1 content
155155

156156

157157

158-
```
158+
````
159159

160160
### `$ cat file* | ./cli -`
161161

162-
```shell
162+
````shell
163163
args:
164164
- ${args[--format]} = json
165165

@@ -174,7 +174,7 @@ file2 content
174174

175175

176176

177-
```
177+
````
178178

179179

180180

examples/catch-all/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $ bashly generate
1515

1616
## `bashly.yml`
1717

18-
```yaml
18+
````yaml
1919
name: download
2020
help: Catch All Example
2121
version: 0.1.0
@@ -31,24 +31,24 @@ args:
3131
flags:
3232
- long: --debug
3333
short: -d
34-
```
34+
````
3535

3636

3737

38-
## Generated script output
38+
## Output
3939

4040
### `$ ./download`
4141

42-
```shell
42+
````shell
4343
missing required argument: MESSAGE
4444
usage: download MESSAGE [OPTIONS] [...]
4545

4646

47-
```
47+
````
4848

4949
### `$ ./download -h`
5050

51-
```shell
51+
````shell
5252
download - Catch All Example
5353

5454
Usage:
@@ -72,22 +72,22 @@ Arguments:
7272

7373

7474

75-
```
75+
````
7676

7777
### `$ ./download something`
7878

79-
```shell
79+
````shell
8080
# this file is located in 'src/root_command.sh'
8181
# you can edit it freely and regenerate (it will not be overwritten)
8282
args:
8383
- ${args[message]} = something
8484

8585

86-
```
86+
````
8787

8888
### `$ ./download something with --additional args`
8989

90-
```shell
90+
````shell
9191
# this file is located in 'src/root_command.sh'
9292
# you can edit it freely and regenerate (it will not be overwritten)
9393
args:
@@ -100,11 +100,11 @@ other_args:
100100
- ${other_args[2]} = args
101101

102102

103-
```
103+
````
104104

105105
### `$ ./download something --debug -- also pass --debug to catch_all`
106106

107-
```shell
107+
````shell
108108
# this file is located in 'src/root_command.sh'
109109
# you can edit it freely and regenerate (it will not be overwritten)
110110
args:
@@ -120,7 +120,7 @@ other_args:
120120
- ${other_args[4]} = catch_all
121121

122122

123-
```
123+
````
124124

125125

126126

0 commit comments

Comments
 (0)