Skip to content

feat(teach): Add teach dashboard subcommand for dynamic website content #275

@Data-Wise

Description

@Data-Wise

Summary

Add teach dashboard subcommand to generate and manage dynamic website dashboard content for Quarto teaching sites. This enables client-side JavaScript to display current week, topic, deadlines, and announcements without requiring site rebuilds.

Motivation

Currently, the STAT 545 course website dashboard requires manual editing of index.qmd and _variables.yml to update weekly content. Since GitHub Pages only serves static files, we've implemented a client-side JavaScript solution that reads from semester-data.json. This feature request adds flow-cli commands to manage that JSON file.

Key Value Proposition: Eliminate weekly manual dashboard updates. Students always see accurate "This Week" content. Announcements auto-expire. Week numbers auto-calculate.

Proposed Commands

teach dashboard                    # Show help
teach dashboard generate           # Generate semester-data.json from teach-config.yml
teach dashboard generate --force   # Overwrite existing JSON
teach dashboard preview            # Preview current week based on date
teach dashboard preview --week 5   # Preview specific week
teach dashboard announce           # Interactive announcement wizard
teach dashboard announce "Title" "Message" --expires DATE --type note
teach dashboard status             # Show dashboard config status

Extended teach-config.yml Schema

Add new optional fields to semester_info.weeks:

semester_info:
  start_date: "2026-01-19"
  end_date: "2026-05-16"
  timezone: "America/Denver"  # NEW
  weeks:
    - number: 1
      topic: "Fundamentals of Experimental Design"
      focus: "Introduction to randomization..."  # NEW (optional)
      lecture:                                    # NEW (optional)
        title: "Introduction to Design Principles"
        url: "lectures/week-01_intro-design_part1.qmd"
      lab:                                        # NEW (optional)
        title: "Getting Started with R & Quarto"
        url: "r_help.qmd"
      assignment:                                 # NEW (optional)
        title: "Assignment 1"
        url: "assignments/assignment1.qmd"
        due: "2026-01-29"
  breaks:
    - name: "Spring Break"
      start: "2026-03-15"
      end: "2026-03-22"
      show_next: true  # NEW (default: true)

dashboard:
  fallback_message: "Check the Syllabus for current week information."
  announcements:
    - id: "welcome-2026"
      type: "note"
      title: "Welcome to Class!"
      date: "2026-01-13"
      content: "Please review the Syllabus..."
      link: "syllabus/syllabus-final.qmd"
      expires: "2026-01-26"

Output: semester-data.json

Generated at .flow/semester-data.json (copied to _site/ by Quarto):

{
  "semester": "Spring 2026",
  "timezone": "America/Denver",
  "start_date": "2026-01-19",
  "end_date": "2026-05-16",
  "fallback_message": "Check the Syllabus...",
  "weeks": [...],
  "breaks": [...],
  "announcements": [...]
}

Implementation Notes

  • Depends on existing teach-config.yml and teach-dates.zsh
  • Should auto-run teach dashboard generate after teach dates sync (configurable)
  • Preview output should use ASCII boxes for terminal display
  • Announcement IDs auto-generated if not specified

Related

  • Spec: docs/specs/SPEC-teach-dashboard-2026-01-18.md
  • Client-side implementation already done in STAT 545 website (stat545.js)
  • Reference: STAT 545 semester-data.json for expected output format

Effort Estimate

~8-12 hours across 4 phases:

  1. Core generate command (3-4h)
  2. Preview command (2-3h)
  3. Announce command (2-3h)
  4. Documentation & tests (1-2h)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions