blob: 20506b817830ce181b991bb4d360f4262f86a4b4 (
plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# Scratch HTML Galerie
Die *Scratch HTML Galerie* erlaubt es eine einfach HTML basierte Gallery
mehrerer Scratch Projekte zu erstellen.
Um Scratch-Projekte im Browser zu verwenden, wird der [TurboWarp Packager](https://github.com/TurboWarp/packager) genutzt.
## Vorraussetzungen
* Python >= 3.10
* (npm) um Scratch Projekte lokal zu HTML zu konvertieren
## Verzeichnisstruktur
Das Programm erwartet, dass das Projektverzeichnis (`projects`) nach folgendem Muster angelegt ist:
```
projects
└── Jahrgang
└── Klasse
└── Project
├── meta.toml -- Meta Informationen zum Project
├── <Scratch Project>.html -- Zu HTML exportierte Scratch Project Datei
└── <Scratch Project>.s3b -- oder Scratch Project Datei
3 directories, 2 files
```
## Benutzung
Um die fertige HTML Gallery zu in einem `build` Verzeichnis zu erzeugen reicht es aus,
das `generate-gallery.py` Skript mit `python` auszuführen.
```
$ python3 generate-gallery.py
```
### Optionen
```
usage: generate-gallery.py [-h] [--author AUTHOR] [--title TITLE]
[--projects-dir PROJECTS_DIR] [--no-packaging]
[--output-dir OUTPUT_DIR]
options:
-h, --help show this help message and exit
--author AUTHOR author mentioned in the HTML
--title TITLE title of the web page
--projects-dir PROJECTS_DIR
location of the projects
--no-packaging do not package all encountered scratch projects
--output-dir OUTPUT_DIR
output location of the generated HTML code
```
|