Skip to content

Commit ccf63fe

Browse files
updated cli to work with new presets format
1 parent ce658f8 commit ccf63fe

7 files changed

Lines changed: 137 additions & 52 deletions

File tree

dist/index.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/presets.yaml

Lines changed: 115 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,48 @@
11
presets:
2-
- id: moodle
3-
name: Moodle
2+
- id: moodle3
3+
name: Moodle3.x
44
logo:
55
icon: 🎓
66
url: ../assets/moodle.svg
77
format: scorm1.2
88
subtitle: SCORM 1.2
9-
description: >
10-
Moodle ist das weltweit am häufigsten verwendete Open-Source-Lernmanagementsystem.
11-
Diese Konfiguration verwendet SCORM 1.2 mit Embed-Modus für Moodle 4.x Kompatibilität.
12-
Für Moodle 3.x empfehlen wir stattdessen den iframe-Modus.
13-
<a href='https://moodle.org' target='_blank'>Mehr erfahren</a>
9+
description:
10+
de: >
11+
Moodle ist das weltweit am häufigsten verwendete Open-Source-Lernmanagementsystem.
12+
Diese Konfiguration verwendet SCORM 1.2 mit Embed-Modus für Moodle 3.x Kompatibilität.
13+
<a href='https://moodle.org' target='_blank'>Mehr erfahren</a>
14+
en: >
15+
Moodle is the world's most widely used open-source learning management system.
16+
This configuration uses SCORM 1.2 with embed mode for Moodle 3.x compatibility.
17+
<a href='https://moodle.org' target='_blank'>Learn more</a>
18+
options:
19+
# SCORM-spezifische Einstellungen
20+
responsiveVoice: false
21+
translateWithGoogle: false
22+
debugging: false
23+
removeBase: false
24+
scormOrganization: ""
25+
typicalDuration: "PT0H5M0S"
26+
scormIframe: true
27+
scormEmbed: false # Empfohlen für Moodle 4
28+
format: scorm1.2
29+
30+
- id: moodle4
31+
name: Moodle4.x
32+
logo:
33+
icon: 🎓
34+
url: ../assets/moodle.svg
35+
format: scorm1.2
36+
subtitle: SCORM 1.2
37+
description:
38+
de: >
39+
Moodle ist das weltweit am häufigsten verwendete Open-Source-Lernmanagementsystem.
40+
Diese Konfiguration verwendet SCORM 1.2 mit Embed-Modus für Moodle 4.x Kompatibilität.
41+
<a href='https://moodle.org' target='_blank'>Mehr erfahren</a>
42+
en: >
43+
Moodle is the world's most widely used open-source learning management system.
44+
This configuration uses SCORM 1.2 with embed mode for Moodle 4.x compatibility.
45+
<a href='https://moodle.org' target='_blank'>Learn more</a>
1446
options:
1547
# SCORM-spezifische Einstellungen
1648
responsiveVoice: false
@@ -30,10 +62,15 @@ presets:
3062
url: ../assets/ilias.png
3163
format: scorm1.2
3264
subtitle: SCORM 1.2
33-
description: >
34-
ILIAS ist ein leistungsstarkes Open-Source-LMS aus Deutschland.
35-
Diese Konfiguration nutzt SCORM 1.2 für bestmögliche Kompatibilität mit ILIAS-Versionen.
36-
<a href='https://www.ilias.de' target='_blank'>Mehr erfahren</a>
65+
description:
66+
de: >
67+
ILIAS ist ein leistungsstarkes Open-Source-LMS aus Deutschland.
68+
Diese Konfiguration nutzt SCORM 1.2 für bestmögliche Kompatibilität mit ILIAS-Versionen.
69+
<a href='https://www.ilias.de' target='_blank'>Mehr erfahren</a>
70+
en: >
71+
ILIAS is a powerful open-source LMS from Germany.
72+
This configuration uses SCORM 1.2 for best compatibility with ILIAS versions.
73+
<a href='https://www.ilias.de' target='_blank'>Learn more</a>
3774
options:
3875
responsiveVoice: false
3976
translateWithGoogle: false
@@ -52,10 +89,15 @@ presets:
5289
url: ../assets/opal.png
5390
format: scorm2004
5491
subtitle: SCORM 2004
55-
description: >
56-
OPAL (Online-Plattform für Akademisches Lehren und Lernen) ist das zentrale LMS
57-
für sächsische Hochschulen. Optimiert für SCORM 2004.
58-
<a href='https://bildungsportal.sachsen.de/opal' target='_blank'>Mehr erfahren</a>
92+
description:
93+
de: >
94+
OPAL (Online-Plattform für Akademisches Lehren und Lernen) ist das zentrale LMS
95+
für sächsische Hochschulen. Optimiert für SCORM 2004.
96+
<a href='https://bildungsportal.sachsen.de/opal' target='_blank'>Mehr erfahren</a>
97+
en: >
98+
OPAL (Online Platform for Academic Teaching and Learning) is the central LMS
99+
for Saxon universities. Optimized for SCORM 2004.
100+
<a href='https://bildungsportal.sachsen.de/opal' target='_blank'>Learn more</a>
59101
options:
60102
responsiveVoice: false
61103
translateWithGoogle: false
@@ -67,16 +109,22 @@ presets:
67109
scormEmbed: false
68110
format: scorm2004
69111

70-
- id: generic
71-
name: Generic LMS
112+
- id: scormCloud
113+
name: ScormCloud
72114
logo:
73-
icon: 🌐
115+
icon: 🌩️
74116
url: ../assets/scorm.png
75117
format: scorm2004
76118
subtitle: SCORM 2004
77-
description: >
78-
Universelle SCORM 2004 Konfiguration für beliebige Lernmanagementsysteme,
79-
die den SCORM 2004 Standard unterstützen. Funktioniert mit den meisten modernen LMS-Plattformen.
119+
description:
120+
de: >
121+
ScormCloud ist eine kommerzielle SCORM-Hosting-Plattform, die von Rustici Software betrieben wird.
122+
Diese Konfiguration bietet universelle SCORM 2004 Einstellungen für maximale Kompatibilität.
123+
<a href='https://scorm.com/scorm-solved/scorm-cloud-features/' target='_blank'>Mehr erfahren</a>
124+
en: >
125+
ScormCloud is a commercial SCORM hosting platform operated by Rustici Software.
126+
This configuration provides universal SCORM 2004 settings for maximum compatibility.
127+
<a href='https://scorm.com/scorm-solved/scorm-cloud-features/' target='_blank'>Learn more</a>
80128
options:
81129
responsiveVoice: false
82130
translateWithGoogle: false
@@ -95,10 +143,15 @@ presets:
95143
url: ../assets/openolat.png
96144
format: scorm1.2
97145
subtitle: SCORM 1.2
98-
description: >
99-
OpenOlat ist eine Open-Source E-Learning-Plattform aus der Schweiz.
100-
Diese Konfiguration nutzt SCORM 1.2 für volle Funktionalität.
101-
<a href='https://www.openolat.com' target='_blank'>Mehr erfahren</a>
146+
description:
147+
de: >
148+
OpenOlat ist eine Open-Source E-Learning-Plattform aus der Schweiz.
149+
Diese Konfiguration nutzt SCORM 1.2 für volle Funktionalität.
150+
<a href='https://www.openolat.com' target='_blank'>Mehr erfahren</a>
151+
en: >
152+
OpenOlat is an open-source e-learning platform from Switzerland.
153+
This configuration uses SCORM 1.2 for full functionality.
154+
<a href='https://www.openolat.com' target='_blank'>Learn more</a>
102155
options:
103156
responsiveVoice: false
104157
translateWithGoogle: false
@@ -117,10 +170,15 @@ presets:
117170
url: ../assets/edx.svg
118171
format: scorm2004
119172
subtitle: SCORM 2004
120-
description: >
121-
Open edX ist die Open-Source-Plattform hinter edX.org und wird weltweit für MOOCs eingesetzt.
122-
Verwendet SCORM 2004 über das SCORM XBlock.
123-
<a href='https://openedx.org' target='_blank'>Mehr erfahren</a>
173+
description:
174+
de: >
175+
Open edX ist die Open-Source-Plattform hinter edX.org und wird weltweit für MOOCs eingesetzt.
176+
Verwendet SCORM 2004 über das SCORM XBlock.
177+
<a href='https://openedx.org' target='_blank'>Mehr erfahren</a>
178+
en: >
179+
Open edX is the open-source platform behind edX.org and is used worldwide for MOOCs.
180+
Uses SCORM 2004 via the SCORM XBlock.
181+
<a href='https://openedx.org' target='_blank'>Learn more</a>
124182
options:
125183
responsiveVoice: false
126184
translateWithGoogle: false
@@ -131,3 +189,31 @@ presets:
131189
scormIframe: true # Oft erforderlich für Open edX
132190
scormEmbed: false
133191
format: scorm2004
192+
193+
- id: learnworlds
194+
name: LearnWorlds
195+
logo:
196+
icon: 🌍
197+
url: ../assets/learnworlds.png
198+
format: scorm2004
199+
subtitle: SCORM 2004
200+
description:
201+
de: >
202+
LearnWorlds ist eine moderne Cloud-basierte Lernplattform für Online-Kursanbieter.
203+
Diese Konfiguration nutzt SCORM 2004 mit Iframe-Modus und masteryScore für beste Kompatibilität.
204+
<a href='https://www.learnworlds.com' target='_blank'>Mehr erfahren</a>
205+
en: >
206+
LearnWorlds is a modern cloud-based learning platform for online course providers.
207+
This configuration uses SCORM 2004 with iframe mode and masteryScore for best compatibility.
208+
<a href='https://www.learnworlds.com' target='_blank'>Learn more</a>
209+
options:
210+
responsiveVoice: false
211+
translateWithGoogle: false
212+
debugging: false
213+
removeBase: false
214+
scormOrganization: ""
215+
typicalDuration: "PT0H5M0S"
216+
scormIframe: true
217+
scormEmbed: false
218+
masteryScore: 80
219+
format: scorm2004

dist/server/public/locales/en.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,9 @@
244244
"status.refreshNow": "Refresh Now",
245245
"status.error": "Error",
246246
"status.errorMessage": "Error loading status",
247-
"presets.moodle.description": "Moodle is the world's most widely used open-source learning management system. This configuration uses SCORM 1.2 for maximum compatibility with Moodle 4.x. For Moodle 3.x we recommend using the iframe mode. <a href='https://moodle.org' target='_blank'>Learn more</a>",
248-
"presets.ilias.description": "ILIAS is a powerful open-source LMS from Germany. This configuration uses SCORM 1.2 for best compatibility with ILIAS versions. <a href='https://www.ilias.de' target='_blank'>Learn more</a>",
247+
"presets.moodle3.description": "Moodle is the world's most widely used open-source learning management system. This configuration uses SCORM 1.2 for maximum compatibility with Moodle 3.x. <a href='https://moodle.org' target='_blank'>Learn more</a>",
248+
"presets.moodle4.description": "Moodle is the world's most widely used open-source learning management system. This configuration uses SCORM 1.2 for maximum compatibility with Moodle 4.x. For Moodle 3.x we recommend using the iframe mode. <a href='https://moodle.org' target='_blank'>Learn more</a>",
249+
"presets.ilias.description": "XXXILIAS is a powerful open-source LMS from Germany. This configuration uses SCORM 1.2 for best compatibility with ILIAS versions. <a href='https://www.ilias.de' target='_blank'>Learn more</a>",
249250
"presets.opal.description": "OPAL (Online Platform for Academic Teaching and Learning) is the central LMS for Saxon universities. Optimized for SCORM 2004. <a href='https://bildungsportal.sachsen.de/opal' target='_blank'>Learn more</a>",
250251
"presets.generic.description": "Universal SCORM 2004 configuration for any learning management systems that support the SCORM 2004 standard. Works with most modern LMS platforms.",
251252
"presets.openolat.description": "OpenOlat is an open-source e-learning platform from Switzerland. This configuration uses SCORM 1.2 for full functionality. <a href='https://www.openolat.com' target='_blank'>Learn more</a>",

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"asset:deduplicate": "./scripts/deduplicate-assets.sh",
3535
"build": "npx parcel build --no-cache --no-source-maps src/index.ts && npm run shebang && npm run copy:public && npm run copy:presets",
3636
"build:debug": "npx parcel build --target node --no-minify --log-level 5 src/index.ts",
37+
"watch": "npx parcel serve --no-cache --no-source-maps src/index.ts --out-dir dist --out-file index.js",
3738
"copy:public": "node scripts/copy-files.js",
3839
"copy:presets": "node scripts/copy-files.js presets",
3940
"run:moodle": "cd docker/moodle && docker-compose up",

src/export/presets.ts

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,20 @@ export function help() {
1919

2020
console.log('\nUsage examples:\n')
2121
console.log(' List all available presets:')
22-
console.log(COLOR.italic(' node dist/index.js -f presets\n'))
22+
console.log(COLOR.italic(' liaex -f presets\n'))
2323

2424
console.log(' Show configuration for a specific preset:')
25-
console.log(
26-
COLOR.italic(' node dist/index.js -f presets --moodle\n'),
27-
)
25+
console.log(COLOR.italic(' liaex -f presets --moodle\n'))
2826

2927
console.log(' Export with preset configuration:')
3028
console.log(
31-
COLOR.italic(
32-
' node dist/index.js -i course.md -f presets --moodle -o output\n',
33-
),
29+
COLOR.italic(' liaex -i course.md -f presets --moodle -o output\n'),
3430
)
3531

3632
console.log(' Override preset parameters with additional flags:')
3733
console.log(
3834
COLOR.italic(
39-
' node dist/index.js -i course.md -f presets --moodle --scorm-organization "My Org" -o output\n',
35+
' liaex -i course.md -f presets --moodle --scorm-organization "My Org" -o output\n',
4036
),
4137
)
4238

@@ -93,11 +89,11 @@ export function listPresets(): void {
9389
console.log('')
9490

9591
config.presets.forEach((preset) => {
96-
console.log(` ${preset.logo} ${COLOR.bold(preset.id)}`)
92+
console.log(` ${preset.logo.icon} ${COLOR.bold(preset.id)}`)
9793
console.log(` ${preset.name} - ${preset.subtitle}`)
9894

9995
// Remove HTML tags from description for console output
100-
const cleanDesc = preset.description
96+
const cleanDesc = preset.description.en
10197
.replace(/<[^>]*>/g, '')
10298
.replace(/\s+/g, ' ')
10399
.trim()
@@ -109,12 +105,12 @@ export function listPresets(): void {
109105
console.log('\nUsage:')
110106
console.log(
111107
COLOR.italic(
112-
' node dist/index.js -i <input.md> -f presets --<preset-id> [-o <output>]',
108+
' liaex -i <input.md> -f presets --<preset-id> [-o <output>]',
113109
),
114110
)
115111
console.log(
116112
COLOR.italic(
117-
' node dist/index.js -i <input.md> -f presets --<preset-id> [--scorm-organization "..."] [-o <output>]\n',
113+
' liaex -i <input.md> -f presets --<preset-id> [--scorm-organization "..."] [-o <output>]\n',
118114
),
119115
)
120116
console.log('Tip: Add format-specific flags to override preset defaults.\n')
@@ -131,7 +127,7 @@ export function showPresetConfig(presetId: string): void {
131127
console.error(`\x1b[31mPreset '${presetId}' not found.\x1b[0m`)
132128
console.log(
133129
'\nRun ' +
134-
COLOR.italic('node dist/index.js -f presets') +
130+
COLOR.italic('liaex -f presets') +
135131
' to see all available presets.\n',
136132
)
137133
process.exit(1)
@@ -164,7 +160,7 @@ export function showPresetConfig(presetId: string): void {
164160
console.log('Usage:')
165161
console.log(
166162
COLOR.italic(
167-
` node dist/index.js -i <input.md> -f presets --${presetId} [-o <output>]`,
163+
` liaex -i <input.md> -f presets --${presetId} [-o <output>]`,
168164
),
169165
)
170166
console.log('')
@@ -174,7 +170,7 @@ export function showPresetConfig(presetId: string): void {
174170
)
175171
console.log(
176172
COLOR.italic(
177-
` node dist/index.js -i <input.md> -f presets --${presetId} --scorm-organization "Custom" -o output`,
173+
` liaex -i <input.md> -f presets --${presetId} --scorm-organization "Custom" -o output`,
178174
),
179175
)
180176
console.log('')

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async function main(): Promise<void> {
3434
// Check for serve command first (positional argument)
3535
const command = argv._[0]
3636

37-
if (command === 'serve') {
37+
if (command === 'serve' || process.env.MODE === 'serve') {
3838
const port = argv.port || argv.p || 3000
3939
await startServer(port)
4040
} else if (argv.v || argv.version) {

src/server/public/locales/en.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,9 @@
244244
"status.refreshNow": "Refresh Now",
245245
"status.error": "Error",
246246
"status.errorMessage": "Error loading status",
247-
"presets.moodle.description": "Moodle is the world's most widely used open-source learning management system. This configuration uses SCORM 1.2 for maximum compatibility with Moodle 4.x. For Moodle 3.x we recommend using the iframe mode. <a href='https://moodle.org' target='_blank'>Learn more</a>",
248-
"presets.ilias.description": "ILIAS is a powerful open-source LMS from Germany. This configuration uses SCORM 1.2 for best compatibility with ILIAS versions. <a href='https://www.ilias.de' target='_blank'>Learn more</a>",
247+
"presets.moodle3.description": "Moodle is the world's most widely used open-source learning management system. This configuration uses SCORM 1.2 for maximum compatibility with Moodle 3.x. <a href='https://moodle.org' target='_blank'>Learn more</a>",
248+
"presets.moodle4.description": "Moodle is the world's most widely used open-source learning management system. This configuration uses SCORM 1.2 for maximum compatibility with Moodle 4.x. For Moodle 3.x we recommend using the iframe mode. <a href='https://moodle.org' target='_blank'>Learn more</a>",
249+
"presets.ilias.description": "XXXILIAS is a powerful open-source LMS from Germany. This configuration uses SCORM 1.2 for best compatibility with ILIAS versions. <a href='https://www.ilias.de' target='_blank'>Learn more</a>",
249250
"presets.opal.description": "OPAL (Online Platform for Academic Teaching and Learning) is the central LMS for Saxon universities. Optimized for SCORM 2004. <a href='https://bildungsportal.sachsen.de/opal' target='_blank'>Learn more</a>",
250251
"presets.generic.description": "Universal SCORM 2004 configuration for any learning management systems that support the SCORM 2004 standard. Works with most modern LMS platforms.",
251252
"presets.openolat.description": "OpenOlat is an open-source e-learning platform from Switzerland. This configuration uses SCORM 1.2 for full functionality. <a href='https://www.openolat.com' target='_blank'>Learn more</a>",

0 commit comments

Comments
 (0)