|
12 | 12 | .PARAMETER GridRows |
13 | 13 | Number of rows per grid (default: 4) |
14 | 14 |
|
15 | | -.PARAMETER GridCols |
| 15 | +.PARAMETER GridColumns |
16 | 16 | Number of columns per grid (default: 4) |
17 | 17 |
|
18 | 18 | .PARAMETER IconHeight |
|
22 | 22 | .\Generate-AzureIconsSlides.ps1 |
23 | 23 |
|
24 | 24 | .EXAMPLE |
25 | | - .\Generate-AzureIconsSlides.ps1 -OutputName "my_azure_icons" -GridRows 3 -GridCols 5 |
| 25 | + .\Generate-AzureIconsSlides.ps1 -OutputName "my_azure_icons" -GridRows 3 -GridColumns 5 |
26 | 26 | #> |
27 | 27 |
|
28 | 28 | param( |
29 | 29 | [int]$GridRows = 4, |
30 | | - [int]$GridCols = 4, |
| 30 | + [int]$GridColumns = 4, |
31 | 31 | [string]$IconHeight = "1cm" |
32 | 32 | ) |
33 | 33 |
|
@@ -220,18 +220,19 @@ function New-MarkdownContent { |
220 | 220 | param( |
221 | 221 | [hashtable]$Categories, |
222 | 222 | [int]$Rows, |
223 | | - [int]$Cols, |
| 223 | + [int]$Columns, |
224 | 224 | [string]$Height |
225 | 225 | ) |
226 | 226 |
|
227 | | - $iconsPerSlide = $Rows * $Cols |
| 227 | + $iconsPerSlide = $Rows * $Columns |
228 | 228 | $markdown = @() |
229 | 229 |
|
230 | 230 | # Header |
231 | 231 | $markdown += "# Azure Service Icons" |
232 | 232 | $markdown += "" |
233 | 233 | $markdown += "<?plotance" |
234 | 234 | $markdown += " slide_level: 3" |
| 235 | + $markdown += " layout_direction: column" |
235 | 236 | $markdown += " body_horizontal_align: center" |
236 | 237 | $markdown += "?>" |
237 | 238 | $markdown += "" |
@@ -260,42 +261,32 @@ function New-MarkdownContent { |
260 | 261 |
|
261 | 262 | # Layout settings |
262 | 263 | $rowSpec = (@($Height, "1") * $Rows) -join ":" |
263 | | - $colSpec = (@("1") * $Cols) -join ":" |
| 264 | + $columnSpec = (@("1") * $Columns) -join ":" |
264 | 265 |
|
265 | 266 | $markdown += "<?plotance" |
266 | 267 | $markdown += " rows: $rowSpec" |
267 | | - $markdown += " columns: $colSpec" |
| 268 | + $markdown += " columns: $columnSpec" |
268 | 269 | $markdown += " body_font_scale: 0.5" |
269 | 270 | $markdown += "?>" |
270 | 271 | $markdown += "" |
271 | 272 |
|
272 | | - for ($rowIndex = 0; $rowIndex -lt $Rows; $rowIndex++) { |
273 | | - # Icons row |
274 | | - for ($colIndex = 0; $colIndex -lt $Cols; $colIndex++) { |
275 | | - $iconIndex = $Cols * $rowIndex + $colIndex |
| 273 | + for ($columnIndex = 0; $columnIndex -lt $Columns; $columnIndex++) { |
| 274 | + for ($rowIndex = 0; $rowIndex -lt $Rows; $rowIndex++) { |
| 275 | + $iconIndex = $Columns * $rowIndex + $columnIndex |
276 | 276 |
|
277 | 277 | if ($iconIndex -lt $slideIcons.Count) { |
278 | 278 | $icon = $slideIcons[$iconIndex] |
279 | 279 | $iconPath = $icon.Path -replace '\\', '/' |
280 | 280 | $markdown += "" |
281 | | - } |
282 | | - else { |
283 | | - $markdown += " " |
284 | | - } |
285 | | - $markdown += "" |
286 | | - } |
287 | | - |
288 | | - # Service names row |
289 | | - for ($colIndex = 0; $colIndex -lt $Cols; $colIndex++) { |
290 | | - $iconIndex = $Cols * $rowIndex + $colIndex |
291 | | - |
292 | | - if ($iconIndex -lt $slideIcons.Count) { |
293 | | - $icon = $slideIcons[$iconIndex] |
| 281 | + $markdown += "" |
294 | 282 | $markdown += $icon.ServiceName |
295 | 283 | } |
296 | 284 | else { |
297 | 285 | $markdown += " " |
| 286 | + $markdown += "" |
| 287 | + $markdown += " " |
298 | 288 | } |
| 289 | + |
299 | 290 | $markdown += "" |
300 | 291 | } |
301 | 292 | } |
@@ -358,7 +349,7 @@ function Main { |
358 | 349 | New-MarkdownContent ` |
359 | 350 | -Categories $categories ` |
360 | 351 | -Rows $GridRows ` |
361 | | - -Cols $GridCols ` |
| 352 | + -Columns $GridColumns ` |
362 | 353 | -Height $IconHeight ` |
363 | 354 | | Out-File -FilePath $markdownFile -Encoding UTF8 |
364 | 355 |
|
|
0 commit comments