Skip to content

Commit 1eeacd2

Browse files
committed
update readme
1 parent 561a62c commit 1eeacd2

1 file changed

Lines changed: 120 additions & 50 deletions

File tree

README.md

Lines changed: 120 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,24 @@ All exports are processed asynchronously in a queue, with only one export runnin
6969

7070
### 3. CLI
7171

72-
For scripting, automation, or CI/CD pipelines, the exporter can be used directly from the command line. Install the same way as above (Node.js + `npm install -g @liascript/exporter`), then see [Basic CLI usage](#Basic-CLI-usage) below.
72+
For scripting, automation, or CI/CD pipelines, the exporter can be used directly from the command line. Install the same way as above (Node.js + `npm install -g @liascript/exporter`).
73+
74+
Once installed, use `liaex` or `liascript-exporter`. Core options:
75+
76+
``` shell
77+
-h --help show help
78+
-i --input input file (Markdown or YAML for projects)
79+
-p --path path to pack (defaults to the input file's directory)
80+
-o --output output file name (default: "output"; extension set by format)
81+
-f --format scorm1.2, scorm2004, ims, web, pdf, epub, docx, xapi,
82+
android, project, rdf, json, fullJson (default: json)
83+
-s --style additional CSS to inject
84+
-v --version print version
85+
-k --key ResponsiveVoice key for text-to-speech
86+
```
87+
88+
Format-specific options are documented in the sections below. You can also run
89+
`liaex --help` at any time to see the full list.
7390
7491
### Docker (Android export)
7592
@@ -97,28 +114,11 @@ this repository:
97114
docker build -t liascript/exporter .
98115
```
99116
100-
## Basic CLI usage
101-
102-
Once installed, use `liaex` or `liascript-exporter`. Core options:
103-
104-
``` shell
105-
-h --help show help
106-
-i --input input file (Markdown or YAML for projects)
107-
-p --path path to pack (defaults to the input file's directory)
108-
-o --output output file name (default: "output"; extension set by format)
109-
-f --format scorm1.2, scorm2004, ims, web, pdf, epub, docx, xapi,
110-
android, project, rdf, json, fullJson (default: json)
111-
-s --style additional CSS to inject
112-
-v --version print version
113-
-k --key ResponsiveVoice key for text-to-speech
114-
```
115-
116-
Format-specific options are documented in the sections below. You can also run
117-
`liaex --help` at any time to see the full list.
117+
## Format Reference
118118
119119
### SCORM1.2
120120
121-
If you want to generate a SCORM1.2 conformant package of you LiaScript-course,
121+
If you want to generate a SCORM1.2 conformant package of your LiaScript-course,
122122
use the following command:
123123
124124
``` shell
@@ -129,12 +129,7 @@ project/README.md
129129
project/Lizenz.md
130130
..
131131
[17:8:33] SCORM 'Init'
132-
[17:8:33] SCORM 'create /tmp/lia202037-30349-o6yx80.zb0eo/pro/imsmanifest.xml'
133-
[17:8:33] SCORM 'create /tmp/lia202037-30349-o6yx80.zb0eo/pro/metadata.xml'
134-
[17:8:33] SCORM 'create /tmp/lia202037-30349-o6yx80.zb0eo/pro/adlcp_rootv1p2.xsd'
135-
[17:8:33] SCORM 'create /tmp/lia202037-30349-o6yx80.zb0eo/pro/ims_xml.xsd'
136-
[17:8:33] SCORM 'create /tmp/lia202037-30349-o6yx80.zb0eo/pro/imscp_rootv1p1p2.xsd'
137-
[17:8:33] SCORM 'create /tmp/lia202037-30349-o6yx80.zb0eo/pro/imsmd_rootv1p2p1.xsd'
132+
...
138133
[17:8:33] SCORM 'Archiving /tmp/lia202037-30349-o6yx80.zb0eo/pro to rockOn.zip'
139134
[17:8:34] SCORM 'rockOn.zip 4977779 total bytes'
140135
Done
@@ -188,10 +183,14 @@ parameter to the directory to be copied into your scorm project. You will still
188183
have to use `--input` to define the main course document, but his has to be
189184
relative to path parameter.
190185
191-
__`--scrom-organization`__
186+
__`--scorm-organization`__
192187
193188
This parameter simply sets the organization parameter in your SCORM
194-
`imsmanifest` file. All other parameters are taken from the course
189+
`imsmanifest` file. All other parameters are taken from the course.
190+
191+
__`--scorm-typicalDuration`__
192+
193+
Set the expected duration of the course in ISO 8601 duration format (e.g. `PT1H30M0S` for 1.5 hours). Default is `PT0H5M0S`.
195194
196195
__`--scorm-iframe`__
197196
@@ -200,6 +199,10 @@ Some LMS like ILIAS or OpenOlat seem to have problems with the required
200199
this parameter can be used. It tries to run the course within an additional
201200
`<iframe>`.
202201
202+
__`--scorm-embed`__
203+
204+
Embed the Markdown source directly into the JavaScript code. Use this for Moodle 4 and other LMS that impose restrictions on dynamic loading of external resources.
205+
203206
### SCORM2004
204207
205208
This output format provides the same settings as `scorm1.2`, but it allows to
@@ -220,25 +223,7 @@ project/README.md
220223
project/Lizenz.md
221224
..
222225
[12:38:31] SCORM 'Init'
223-
[12:38:31] SCORM 'create /tmp/lia2022114-556265-d2jh0k.odg7e/pro/imsmanifest.xml'
224-
[12:38:31] SCORM 'create /tmp/lia2022114-556265-d2jh0k.odg7e/pro/metadata.xml'
225-
[12:38:31] SCORM 'create /tmp/lia2022114-556265-d2jh0k.odg7e/pro/XMLSchema.dtd'
226-
[12:38:31] SCORM 'create /tmp/lia2022114-556265-d2jh0k.odg7e/pro/adlcp_v1p3.xsd'
227-
[12:38:31] SCORM 'create /tmp/lia2022114-556265-d2jh0k.odg7e/pro/adlnav_v1p3.xsd'
228-
[12:38:31] SCORM 'create /tmp/lia2022114-556265-d2jh0k.odg7e/pro/adlseq_v1p3.xsd'
229-
[12:38:31] SCORM 'create /tmp/lia2022114-556265-d2jh0k.odg7e/pro/datatypes.dtd'
230-
[12:38:31] SCORM 'create /tmp/lia2022114-556265-d2jh0k.odg7e/pro/imscp_v1p1.xsd'
231-
[12:38:31] SCORM 'create /tmp/lia2022114-556265-d2jh0k.odg7e/pro/imsss_v1p0.xsd'
232-
[12:38:31] SCORM 'create /tmp/lia2022114-556265-d2jh0k.odg7e/pro/imsss_v1p0auxresource.xsd'
233-
[12:38:31] SCORM 'create /tmp/lia2022114-556265-d2jh0k.odg7e/pro/imsss_v1p0control.xsd'
234-
[12:38:31] SCORM 'create /tmp/lia2022114-556265-d2jh0k.odg7e/pro/imsss_v1p0delivery.xsd'
235-
[12:38:31] SCORM 'create /tmp/lia2022114-556265-d2jh0k.odg7e/pro/imsss_v1p0limit.xsd'
236-
[12:38:31] SCORM 'create /tmp/lia2022114-556265-d2jh0k.odg7e/pro/imsss_v1p0objective.xsd'
237-
[12:38:31] SCORM 'create /tmp/lia2022114-556265-d2jh0k.odg7e/pro/imsss_v1p0random.xsd'
238-
[12:38:31] SCORM 'create /tmp/lia2022114-556265-d2jh0k.odg7e/pro/imsss_v1p0rollup.xsd'
239-
[12:38:31] SCORM 'create /tmp/lia2022114-556265-d2jh0k.odg7e/pro/imsss_v1p0seqrule.xsd'
240-
[12:38:31] SCORM 'create /tmp/lia2022114-556265-d2jh0k.odg7e/pro/imsss_v1p0util.xsd'
241-
[12:38:31] SCORM 'create /tmp/lia2022114-556265-d2jh0k.odg7e/pro/xml.xsd'
226+
...
242227
[12:38:31] SCORM 'Archiving /tmp/lia2022114-556265-d2jh0k.odg7e/pro to rockOn.zip'
243228
[12:38:32] SCORM 'rockOn.zip 19588706 total bytes'
244229
Done
@@ -338,7 +323,7 @@ __`--web-iframe`:__ This will put the course into an secondary iframe, which wil
338323
hide the course-URL (the Markdown-file). Unfortunately, it will not be possible
339324
anymore to link from outside to a specific slide.
340325
341-
__`web-indexeddb`:__ Generate a LiaScript package that will store states persistently.
326+
__`--web-indexeddb`:__ Generate a LiaScript package that will store states persistently.
342327
By default, the database is generated uniquely for the packed course. That means,
343328
every update will use a new database, which makes sense, if and only if, typos get
344329
corrected or content is added to the end of the document. Mixing content and moving
@@ -352,6 +337,20 @@ updating description ...
352337
updating logo ...
353338
```
354339
340+
> **Note:** Web exports must be served over HTTP — opening `index.html` directly
341+
> in a browser (`file://`) will not work due to browser security restrictions.
342+
> To preview locally, use any static file server, for example:
343+
>
344+
> ```shell
345+
> # using Node.js serve
346+
> npx serve outputFolder
347+
>
348+
> # using Python
349+
> python3 -m http.server --directory outputFolder
350+
> ```
351+
>
352+
> Then open `http://localhost:3000` (or the port shown) in your browser.
353+
355354
### Android
356355
357356
> **Tip:** Setting up the Android SDK locally can be complex. The easiest approach
@@ -360,7 +359,7 @@ updating logo ...
360359
To generate an APK project of your course locally, download the
361360
[Android SDK](https://developer.android.com/studio) and provide the path
362361
via the option `--android-sdk`. Additionally you will have to define an `appId`
363-
via `--android-appId`, which is in most cases an unique URL (in reverse order)
362+
via `--android-appId`, which is in most cases a unique URL (in reverse order)
364363
that is pointing to your website/project. This export uses
365364
[capacitorjs](https://capacitorjs.com) to pack the entire LiaScript runtime
366365
environment and your resources into one installable Android apk.
@@ -441,6 +440,22 @@ $ ls
441440
> If you want to preview the result, simply use `--android-preview`, which will
442441
> open android-studio
443442
443+
__`--android-appName`__
444+
445+
Name of the app. The main title of the course is used as default.
446+
447+
__`--android-icon`__
448+
449+
Optional app icon image (1024x1024 px).
450+
451+
__`--android-splash`__
452+
453+
Optional splash screen image (2732x2732 px).
454+
455+
__`--android-splashDuration`__
456+
457+
Duration for the splash screen in milliseconds. Default is 0.
458+
444459
__Still a bit experimental__
445460
446461
### PDF
@@ -523,6 +538,40 @@ $ liaex --format pdf \
523538
depending on the size of the course, this can take a while, please be patient...
524539
```
525540
541+
The following are puppeteer-specific settings (see [puppeteer PDF options](https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#pagepdfoptions)):
542+
543+
__`--pdf-scale`__ Scale of the webpage rendering. Defaults to 1. Must be between 0.1 and 2.
544+
545+
__`--pdf-displayHeaderFooter`__ Display header and footer. Defaults to false.
546+
547+
__`--pdf-headerTemplate`__ HTML template for the print header. You can use the classes `date`, `title`, `url`, `pageNumber`, `totalPages`.
548+
549+
__`--pdf-footerTemplate`__ HTML template for the print footer. Same format as `--pdf-headerTemplate`.
550+
551+
__`--pdf-printBackground`__ Print background graphics. Defaults to false.
552+
553+
__`--pdf-landscape`__ Paper orientation. Defaults to false.
554+
555+
__`--pdf-pageRanges`__ Paper ranges to print, e.g. `"1-5, 8, 11-13"`.
556+
557+
__`--pdf-format`__ Paper format (e.g. `A4`, `Letter`). Takes priority over width/height. Defaults to A4.
558+
559+
__`--pdf-width`__ Paper width, accepts values with units (e.g. `210mm`).
560+
561+
__`--pdf-height`__ Paper height, accepts values with units.
562+
563+
__`--pdf-margin-top`__ Top margin, accepts values with units.
564+
565+
__`--pdf-margin-right`__ Right margin, accepts values with units.
566+
567+
__`--pdf-margin-bottom`__ Bottom margin, accepts values with units.
568+
569+
__`--pdf-margin-left`__ Left margin, accepts values with units.
570+
571+
__`--pdf-preferCSSPageSize`__ Give any CSS `@page` size declared in the page priority over `--pdf-format` / width / height options.
572+
573+
__`--pdf-omitBackground`__ Hide the default white background, allowing screenshots with transparency. Defaults to true.
574+
526575
### ePub
527576
528577
ePub export generates e-books from your LiaScript course using Puppeteer to render content and the `@lesjoursfr/html-to-epub` library to produce the ePub file. The output is compatible with most e-readers.
@@ -787,10 +836,30 @@ Such as, for which projects you want to generate a pdf and pass also all additio
787836
Simply pass all arguments as `arguments` with the long name and without the starting dashes.
788837
This way you can generate a very detailed project configuration and overview.
789838
839+
**Project settings:**
840+
841+
`--project-no-meta` Disable the generation of meta information for OpenGraph and Twitter-cards.
842+
843+
`--project-no-rdf` Disable the generation of JSON-LD.
844+
845+
`--project-no-categories` Disable the filter for categories/tags.
846+
847+
`--project-category-blur` Instead of hiding courses that do not match a selected category, blur them.
848+
849+
`--project-generate-scorm12` Generate a SCORM 1.2 package for every course. Pass additional SCORM settings alongside this flag.
850+
851+
`--project-generate-scorm2004` Generate a SCORM 2004 package for every course. Pass additional SCORM settings alongside this flag.
852+
853+
`--project-generate-ims` Generate IMS resources for every course. Pass additional IMS settings alongside this flag.
854+
855+
`--project-generate-pdf` PDFs are automatically generated and added to every card. Pass additional PDF settings alongside this flag.
856+
857+
`--project-generate-cache` Only generate new files if they do not already exist.
858+
790859
791860
### RDF & JSON-LD
792861
793-
The LiaScript metainformation can be exported to RDF, either as json-ld or as n-quads. The option `--pdf-preview` generates a console output that can be used to inspect the result. Otherwise the result is stored in a file, defined by `-o`, the file-ending is either `.jsonld` or `.nq`, depending on the `--rdf-format`
862+
The LiaScript metainformation can be exported to RDF, either as json-ld or as n-quads. The option `--rdf-preview` generates a console output that can be used to inspect the result. Otherwise the result is stored in a file, defined by `-o`, the file-ending is either `.jsonld` or `.nq`, depending on the `--rdf-format`
794863
795864
``` shell
796865
liaex --format rdf --rdf-preview -i https://raw.githubusercontent.com/liaScript/docs/master/README.md
@@ -891,6 +960,7 @@ liaex --format rdf --rdf-preview -i ../LiaBooks/docs/README.md
891960
* `--rdf-type`: By default this type of resource is associated with `Course`, but you can use this param if you want to define `EducationalResource` or something else...
892961
* `--rdf-educationalLevel`: This is currently not defined, but can be injected, typically these are beginner, intermediate, advanced, ...
893962
* `--rdf-license`: Use this to specify the URL of the associated license to your course. This tool will automatically check if there is a LICENSE file in your project root and add this.
963+
* `--rdf-template`: Use a URL or local JSON file as a base template for the RDF output.
894964
895965
#### What LiaScript meta-information is used
896966

0 commit comments

Comments
 (0)