# docs/source/conf.py
import os
import sys
import django
from pathlib import Path

# Add Django project to path
BASE_DIR = Path(__file__).resolve().parent.parent.parent
sys.path.insert(0, str(BASE_DIR))
os.environ['DJANGO_SETTINGS_MODULE'] = 'backend.settings'

# Setup Django - this will load all your models
django.setup()

# Project information
project = 'Rapha-Bethel BNPS School Management System'
copyright = '2026, Vi-2s-Dk Foundation'
author = 'Vi-2s-Dk Foundation'
release = '1.0.0'

# Extensions
extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.napoleon',
    'sphinx_rtd_theme',
]

# Napoleon settings
napoleon_google_docstring = True
napoleon_include_init_with_doc = True
napoleon_include_private_with_doc = False
napoleon_use_param = True
napoleon_use_rtype = True

# Autodoc settings
autodoc_default_options = {
    'members': True,
    'undoc-members': True,
    'show-inheritance': True,
}

# Mock any problematic imports
autodoc_mock_imports = [
    'PIL',  # For ImageField
]

# HTML output
html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']