How MicroSim Files Integrate into MkDocs Textbooks
This diagram shows how the three core MicroSim files (index.md, main.html, metadata.json) relate to each other and integrate into the MkDocs intelligent textbook architecture. The diagram illustrates the flow from student navigation through the documentation to the interactive simulation, including security boundaries and metadata cataloging.
Type: Documentation Page
Purpose: Student-facing documentation that provides context, instructions, and learning objectives for the MicroSim.
Location: docs/sims/{name}/index.md
Contains: Description, iframe embed, usage instructions, educational context
Type: HTML Integration Point
Purpose: Provides security boundary and sandbox isolation for the interactive simulation.
Security: Prevents simulation from accessing parent page DOM
Note: Embedded within index.md using markdown/HTML
Type: Interactive HTML Page
Purpose: Self-contained interactive visualization using p5.js or other libraries.
Location: docs/sims/{name}/main.html
Dependencies: Loads p5.js from CDN, includes simulation code
Type: Canvas Rendering
Purpose: Interactive educational visualization rendered on HTML5 canvas.
Features: Real-time interaction, dynamic updates, visual feedback
Library: p5.js loaded from CDN
Type: External Integration (Optional)
Purpose: Import MicroSim metadata into LMS for course organization and tracking.
Connection: Reads metadata.json for course integration
Examples: Canvas, Moodle, Blackboard
iframe Sandbox: The iframe element creates a security boundary that prevents the simulation (main.html) from accessing the parent MkDocs page. This isolation ensures: