# Framework Global Settings
# This file contains your default settings for all Framework projects.
# Location: ~/.config/framework/settings.yml
# VERSION 2: Reorganized around scaffold() workflow
# Edit this file to change your defaults, or use: framework configure:*

meta:
  version: 2
  description: "Framework global settings"

# Author information (used in new projects)
author:
  name: "Your Name"
  email: "your.email@example.com"
  affiliation: "Your Institution"

# Global settings
global:
  projects_root: "~/projects"  # Default location for new projects

# Default settings for new projects
defaults:
  project_type: "project"  # project, course, presentation, project_sensitive

  # Scaffold Behavior (runtime settings)
  scaffold:
    seed_on_scaffold: false              # Automatically set seed when scaffold() runs
    seed: "123"                          # Default random seed (e.g., "20241107")
    set_theme_on_scaffold: false         # Set ggplot2 theme when scaffold() runs
    ggplot_theme: "theme_minimal"        # ggplot2 theme
    source_all_functions: true           # Source all R files from functions/ directory
    notebook_format: "quarto"            # quarto or rmarkdown
    ide: "vscode"                        # vscode, rstudio, both, or none

  # Packages & Dependencies
  packages:
    use_renv: false                      # Use renv for package management
    default_packages:
      # Core tidyverse (auto-attached for immediate use)
      - name: "dplyr"
        auto_attach: true
      - name: "ggplot2"
        auto_attach: true
      - name: "tidyr"
        auto_attach: true
      - name: "stringr"
        auto_attach: true
      - name: "readr"
        auto_attach: true
      # Utility packages (installed but not auto-attached)
      - name: "lubridate"
        auto_attach: false
      - name: "glue"
        auto_attach: false
      - name: "here"
        auto_attach: false

  # Quarto Defaults (applied when generating _quarto.yml files)
  quarto:
    html:
      format: "html"
      embed_resources: true             # Produce standalone HTML with all dependencies embedded
      theme: "default"                  # Bootstrap theme
      toc: true                         # Table of contents
      toc_depth: 3                      # TOC heading depth
      code_fold: false                  # Allow collapsing code blocks
      code_tools: false                 # Provide code download/viewing options
      highlight_style: "github"         # Syntax highlighting theme
    revealjs:
      format: "revealjs"
      theme: "default"                  # Presentation theme
      incremental: false                # Reveal list items incrementally
      slide_number: true                # Show slide numbers
      transition: "slide"               # Slide transition effect
      background_transition: "fade"     # Background transition effect
      controls: true                    # Show navigation controls
      progress: true                    # Show progress bar
      center: true                      # Center slide content
      highlight_style: "github"         # Syntax highlighting theme

  # AI Assistants
  ai:
    enabled: true                        # Enable AI support
    canonical_file: "CLAUDE.md"          # Canonical context file
    preferred_assistant: "claude"        # Preferred AI assistant
    assistants:
      - "claude"

  # .env template (applied to every new project)
  env:
    raw: |-
      # Framework environment defaults
      # Populate these values before running scaffold() or publishing.

      # PostgreSQL connection (example)
      POSTGRES_HOST=
      POSTGRES_PORT=5432
      POSTGRES_DB=
      POSTGRES_SCHEMA=public
      POSTGRES_USER=
      POSTGRES_PASSWORD=

      # S3-compatible storage (AWS S3, MinIO, etc.)
      S3_BUCKET=
      S3_ACCESS_KEY=
      S3_SECRET_KEY=
      S3_REGION=
      S3_ENDPOINT=
      S3_SESSION_TOKEN=

  # Default connection definitions
  connections:
    options:
      default_connection: "framework"
    connections:
      framework:
        driver: "sqlite"
        database: "framework.db"

  # Git & Hooks
  git:
    initialize: true                     # Initialize git repository
    gitignore_template: "gitignore-project"  # Default .gitignore template
    hooks:
      ai_sync: false                     # Sync AI context on commit
      data_security: false               # Scan for secrets in commits

# Stubs & Templates
templates:
  notebook:
    quarto_default: "notebook-default.qmd"
    rmarkdown_default: "notebook-default.Rmd"
  script:
    r_default: "script-default.R"
  gitignore:
    available:
      - "gitignore-project"
      - "gitignore-sensitive"
      - "gitignore-course"
      - "gitignore-presentation"

# Project type definitions
project_types:
  project:
    label: "Standard Project Structure"
    description: "Full-featured project with organized data, work, and output directories"
    scaffold:
      set_theme_on_scaffold: true        # Automatically set ggplot theme when scaffold() runs
      ggplot_theme: "theme_minimal"      # ggplot2 theme
    directories:
      notebooks: "notebooks"
      scripts: "scripts"
      functions: "functions"
      inputs_raw: "inputs/raw"
      inputs_intermediate: "inputs/intermediate"
      inputs_final: "inputs/final"
      docs: "docs"
      outputs_notebooks: "outputs/notebooks"
      outputs_tables: "outputs/tables"
      outputs_figures: "outputs/figures"
      outputs_models: "outputs/models"
      outputs_reports: "outputs/reports"
      cache: "outputs/cache"
      scratch: "scratch"

  course:
    label: "Course/Teaching"
    description: "Simplified structure for teaching materials"
    scaffold:
      set_theme_on_scaffold: true
      ggplot_theme: "theme_minimal"
    directories:
      data: "data"
      slides: "slides"
      assignments: "assignments"
      course_docs: "course_docs"
      readings: "readings"
      notebooks: "modules"
      cache: "cache"

  presentation:
    label: "Presentation"
    description: "Minimal structure for slides and presentations"
    scaffold:
      set_theme_on_scaffold: true
      ggplot_theme: "theme_minimal"
    directories:
      presentation_source: "presentation.qmd"
      rendered_slides: "."
      data: "data"
      cache: "cache"

  project_sensitive:
    label: "Privacy Sensitive Project"
    description: "Enhanced privacy controls for sensitive data"
    scaffold:
      set_theme_on_scaffold: true
      ggplot_theme: "theme_minimal"
    directories:
      functions: "functions"
      notebooks: "notebooks"
      scripts: "scripts"
      inputs_private_raw: "inputs/private/raw"
      inputs_public_raw: "inputs/public/raw"
      inputs_private_intermediate: "inputs/private/intermediate"
      inputs_public_intermediate: "inputs/public/intermediate"
      inputs_private_final: "inputs/private/final"
      inputs_public_final: "inputs/public/final"
      outputs_private_notebooks: "outputs/private/notebooks"
      outputs_public_notebooks: "outputs/public/notebooks"
      outputs_private_tables: "outputs/private/tables"
      outputs_public_tables: "outputs/public/tables"
      outputs_private_figures: "outputs/private/figures"
      outputs_public_figures: "outputs/public/figures"
      outputs_private_models: "outputs/private/models"
      outputs_public_models: "outputs/public/models"
      outputs_private_reports: "outputs/private/reports"
      outputs_public_reports: "outputs/public/reports"
      cache: "outputs/private/cache"
      scratch: "scratch"
