preview_html.py Documentation¶
Introduction¶
preview_html.py renders a Nobius sheet and creates a local HTML preview site that can be opened directly in a browser. It is useful for checking question structure, theme CSS, help-panel behaviour, and MathJax rendering before importing a package into Mobius.
Usage¶
Run the script from the Nobius directory:
python preview_html.py SHEET_PATH [--profile PROFILE] [--render-mode {assignment,exercise}] [--config CONFIG] [--output-dir OUTPUT_DIR]
Where:
SHEET_PATHis the path to the Nobius sheet directory.--profileselects the named Nobius profile. If omitted, the config'shtml_preview_profileis used.--render-modeselects the manifest/layout shape. Useassignmentfor assignment-style output andexercisefor question-bank style output.--configpoints to the Nobius config JSON file. By default the tool usesnobius.jsonfrom the repo root.--output-diroverrides the preview destination. By default the preview is written under the sheet'srenders/folder.
Output¶
The preview generator creates:
- an
index.htmlpage listing the questions in the sheet - one HTML page per question
- a local
assets/folder containing extracted media from the rendered ZIP
Open index.html in a browser to inspect the rendered questions.
Notes¶
- The preview embeds the tracked theme CSS and preview JS directly into the generated pages.
- MathJax is loaded from CDN and renders
\(...\)and\[...\]expressions. - The preview is intended for local inspection. It does not replace a real Mobius import test.