-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparse-theme.php
More file actions
30 lines (24 loc) · 818 Bytes
/
Copy pathparse-theme.php
File metadata and controls
30 lines (24 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env php
<?php
declare(strict_types=1);
require __DIR__ . '/../vendor/autoload.php';
use ProPresenter\Parser\ThemeFileReader;
if ($argc < 2) {
echo "Usage: parse-theme.php <theme-folder>\n";
exit(1);
}
try {
$bundle = ThemeFileReader::read($argv[1]);
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage() . "\n";
exit(1);
}
echo "Theme folder: {$argv[1]}\n";
echo 'Slides (' . $bundle->count() . "):\n";
foreach ($bundle->getSlides() as $index => $slide) {
echo sprintf(" [%d] %s\n", $index + 1, $slide->getName() ?: '(unnamed)');
}
echo 'Assets (' . $bundle->getAssetCount() . "):\n";
foreach ($bundle->getAssets() as $index => $asset) {
echo sprintf(" [%d] Assets/%s :: %d bytes :: %s\n", $index + 1, $asset->getName(), $asset->getSize(), $asset->getMimeType());
}