Files
hudra/docs/ARCHITECTURE.md
2026-07-26 16:02:28 +10:00

74 lines
2.0 KiB
Markdown

# Hudra Architecture
## Overview
Hudra is a Manifest V3 browser extension that presents the existing DOM of an
HTML lesson.
It does not convert the lesson into a proprietary format.
## Slide detection
The current presentation model uses HTML headings:
- H1 identifies the lesson title
- H2 identifies the beginning of a new slide
- H3 identifies the beginning of a new slide
- H4 identifies a subsection within the current slide
- content following an H2 or H3 belongs to that slide until the next H2 or H3
Pages without H2 or H3 headings are presented as a single slide.
## Supported pages
Hudra starts only on secure QLearn pages at `qlearn.eq.edu.au` (including
subdomains) and Canvas pages on an `instructure.com` subdomain. A supported
page must also contain a recognised lesson-content container and an H1 lesson
title. Unsupported pages receive a temporary in-page notice and are not put
into presentation mode.
## Main components
### background.js
Handles extension-level behaviour and presentation launch logic.
Active session routing and window-restoration metadata is kept in
`chrome.storage.session` so presenter controls survive service-worker restarts.
Lesson content and slide previews are not persisted.
### controls.html
Provides the presenter dashboard interface.
### controls.css
Styles the presenter controls.
### controls.js
Manages presenter navigation, controls and audience communication.
### presenter.js
Creates and manages the audience presentation experience.
### page-detection.js
Contains the shared lesson-container and title detection used before launch
and when presentation mode starts.
### manifest.json
Defines the extension metadata, permissions and version.
## Design constraints
Hudra should avoid:
- cloning complex media unnecessarily
- fragile LMS-specific DOM assumptions
- large content-detection systems
- destructive modification of the original lesson
New media features should be implemented and tested independently.