You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pre-rendered HTML + CSS + JS files in output/ directory
Process
1. TCCCompiler compiles each .ch file
2. CBI macros (#html, #css, #js, #md) transform into HtmlPage method calls
3. Each concept's render() function produces a complete HTML page string
4. main.ch writes each page to output/<concept-name>.html
5. Output includes: HTML file + embedded CSS + embedded JS
Validation (Compile-time)
Rule
Error
Missing render() function
Compiler error
Invalid #html syntax
Compiler error
Undefined variables in #js
Compiler error
Import errors
Compiler error
Stage 3: Static Files (Build Time)
Input
Compiled concept pages (from Stage 2)
Output
Pre-rendered HTML + CSS + JS files in output/ directory
Process
1. Each concept produces: <concept>.html + <concept>.css + <concept>.js
2. CSS is embedded in <style> tag in <head>
3. JS is embedded in <script> tag at end of <body>
4. All files are self-contained (no external dependencies)
5. Files are ready to serve from any HTTP server or CDN
1. Load learner state
- Concept mastery (status, accuracy, streak)
- Session history (time spent, accuracy)
- Energy level (self-reported)
2. Apply adaptive path
- Skip mastered concepts in navigation
- Highlight concepts due for review
- Insert reminder banners for forgotten concepts
3. Personalize page
- Show/hide sections based on mastery
- Adjust difficulty indicators
- Add personalized review reminders
Note: For MVP, personalization is minimal. The pre-rendered page is served directly. Personalization is added via JS that reads learner state from the server.
Stage 5: Serve
Input
Pre-rendered HTML + CSS + JS files (from Stage 3)
Output
HTTP response with complete HTML page
Process
1. Request arrives: GET /api/courses/elf/lessons/bytes
2. Router matches to lesson handler
3. Handler reads courses/elf/output/bytes.html (pre-rendered)
4. Handler returns HTML file with Content-Type: text/html
5. Browser receives complete HTML page
HTML Structure (Pre-rendered)
<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport" content="width=device-width, initial-scale=1.0"><title>Bytes and Binary — Underlayer</title><style>/* Embedded CSS from #css { } block */
.lesson { max-width:800px; margin:0 auto; padding:2rem; }
...
</style></head><body><!-- Embedded HTML from #html { } block --><divclass="lesson" data-concept="bytes"><h1>Bytes and Binary</h1>
...
</div><script>/* Embedded JS from #js { } block */functioncheckQuiz(id,btn,correct){ ... }</script></body></html>
Stage 6: Interact
Browser Execution
1. Browser receives HTML page
2. CSS is parsed and applied
3. HTML is rendered
4. JS is executed:
a. Quiz handlers are bound to buttons
b. Hex viewer highlights are activated
c. Interactive demos are initialized
5. User interacts:
a. Clicks quiz option → checkQuiz() runs → feedback shown
b. Hovers hex byte → field name highlighted
c. Types in input → validation runs
6. Progress is tracked:
a. Quiz results sent to server via fetch()
b. Session data recorded
c. Learner state updated