Docs / Import and export

Writing and updating a course with an AI

Choosing the right path

  • Writing a page or a small addition: write the Markdown of the page (see the page format) and paste it into the editor.
  • Writing or rewriting a whole course, or having it reviewed: export the course as a single file (“with references” if the resources stay in the same account, “with resources” for another account), work on it in a chat or text editor, then use Update from a file (existing course) or Import (new course).
  • Backup or very large course: use the ZIP archive.

An AI cannot upload a file by itself: you export, paste the content, get the edited file back and import it. Ask the AI to return the complete file, never “the rest is unchanged”.

Checklist for a re-importable file

  1. Keep the first line, the separators and every id, baseHash, courseId and sourceId field. A new page or module has no id.
  2. Links between pages use the key: [[page:my-key]]; keys are unique.
  3. Resource tags keep the existing id (or res:<key> in resources mode). Never invent the id of a game, repertoire or suite.
  4. One tag per line; ::youtube{...} alone on its line.
  5. Moves in English SAN. Every FEN and every ::diagram line must be checked: see FEN formats and validation.
  6. ply between 0 and the number of half-moves of moves; no variations or NAGs inside moves.
  7. Page source up to 1 MB (each language version up to 256 KB once compiled); at most 50 modules and 500 pages.
  8. No line that looks like <!-- lilychess:... --> inside page text.
  9. Give every diagram and resource an explicit id and label.

When an import or update fails

  • Read the report: each message gives a code, a line number (single file) or file name (ZIP), and the block concerned. Fix that precise point without rewriting the rest.
  • FRONTMATTER_INVALID with “put it in quotes”: quote the value.
  • DUPLICATE_ID: a page was copied with its id; remove id and baseHash from the copy.
  • COURSE_MISMATCH: the file comes from another course; export again from the right course, or explicitly accept treating everything as new.
  • Conflict on a page: it was edited online since the export; choose between overwriting and skipping.
  • INSUFFICIENT_CREDITS: check the quote and decide.

Remember

  • An import creates a private course with draft pages; an update only writes drafts. Republish the affected pages so participants see the changes.
  • Resources recreated by an import are private; share them if the course is meant for other people.
  • A backup is made before every update and can be downloaded for 24 hours.

Reference: single-file format, formats, modes and errors, updating a course.