# Material Theme MkDocs Configuration Template
# Generated by d361 MkDocs Export System
# this_file: external/int_folders/d361/src/d361/mkdocs/templates/material_theme.yml.j2

# Basic site configuration
site_name: {{ site_name | default('Document360 Export') }}
{% if site_url %}site_url: {{ site_url }}{% endif %}
{% if site_author %}site_author: {{ site_author }}{% endif %}
{% if site_description %}site_description: {{ site_description }}{% endif %}
{% if repo_url %}repo_url: {{ repo_url }}{% endif %}
{% if repo_name %}repo_name: {{ repo_name }}{% endif %}

# Build directories
docs_dir: {{ docs_dir | default('docs') }}
site_dir: {{ site_dir | default('site') }}

# Material theme configuration
theme:
  name: material
  {% if language %}language: {{ language }}{% endif %}
  {% if custom_dir %}custom_dir: {{ custom_dir }}{% endif %}
  
  # Theme features
  features:
    - navigation.instant
    - navigation.instant.prefetch
    - navigation.tracking
    - navigation.tabs
    - navigation.tabs.sticky
    - navigation.sections
    - navigation.expand
    - navigation.path
    - navigation.prune
    - navigation.indexes
    - navigation.top
    - search.suggest
    - search.highlight
    - search.share
    - header.autohide
    - content.action.edit
    - content.action.view
    - content.code.copy
    - content.code.select
    - content.tooltips
    {% if enable_tabs | default(false) %}- content.tabs.link{% endif %}
    {% if enable_feedback | default(false) %}- content.feedback.back
    - content.feedback.general{% endif %}

  # Color palette
  palette:
    {% if color_scheme == 'auto' %}
    - media: "(prefers-color-scheme: light)"
      scheme: default
      primary: {{ primary_color | default('indigo') }}
      accent: {{ accent_color | default('indigo') }}
      toggle:
        icon: material/brightness-7
        name: Switch to dark mode
    - media: "(prefers-color-scheme: dark)"
      scheme: slate
      primary: {{ primary_color | default('indigo') }}
      accent: {{ accent_color | default('indigo') }}
      toggle:
        icon: material/brightness-4
        name: Switch to light mode
    {% else %}
    - scheme: {{ color_scheme | default('default') }}
      primary: {{ primary_color | default('indigo') }}
      accent: {{ accent_color | default('indigo') }}
    {% endif %}

  # Typography
  font:
    text: {{ text_font | default('Roboto') }}
    code: {{ code_font | default('Roboto Mono') }}

  # Icons
  {% if logo %}logo: {{ logo }}{% endif %}
  {% if favicon %}favicon: {{ favicon }}{% endif %}
  icon:
    repo: {{ repo_icon | default('fontawesome/brands/github') }}
    {% if enable_edit %}edit: material/pencil{% endif %}
    {% if enable_view %}view: material/eye{% endif %}

# Navigation
{% if navigation %}
nav:
{% for item in navigation %}
  {{ item | indent(2, true) }}
{% endfor %}
{% endif %}

# Enhanced Markdown extensions for Material
markdown_extensions:
  # Built-in extensions
  - abbr
  - admonition
  - attr_list
  - def_list
  - footnotes
  - md_in_html
  - tables
  - toc:
      permalink: true
      toc_depth: {{ toc_depth | default(3) }}
      permalink_title: Anchor link to this section for reference

  # PyMdown Extensions
  - pymdownx.arithmatex:
      generic: true
  - pymdownx.betterem:
      smart_enable: all
  - pymdownx.caret
  - pymdownx.details
  - pymdownx.emoji:
      emoji_generator: !!python/name:material.extensions.emoji.to_svg
      emoji_index: !!python/name:material.extensions.emoji.twemoji
  - pymdownx.highlight:
      anchor_linenums: true
      line_spans: __span
      pygments_lang_class: true
  - pymdownx.inlinehilite
  - pymdownx.keys
  - pymdownx.magiclink:
      normalize_issue_symbols: true
      repo_url_shorthand: true
      user: {{ github_user | default('') }}
      repo: {{ github_repo | default('') }}
  - pymdownx.mark
  - pymdownx.smartsymbols
  - pymdownx.snippets:
      check_paths: true
  - pymdownx.superfences:
      custom_fences:
        - name: mermaid
          class: mermaid
          format: !!python/name:pymdownx.superfences.fence_code_format
  - pymdownx.tabbed:
      alternate_style: true
      combine_header_slug: true
      slugify: !!python/object/apply:pymdownx.slugs.slugify
        kwds:
          case: lower
  - pymdownx.tasklist:
      custom_checkbox: true
  - pymdownx.tilde

# Enhanced plugins for Material
plugins:
  - search:
      lang: {{ search_lang | default(['en']) }}
      separator: '[\s\u200b\-_,:!=\[\]()"`/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])'
  {% if enable_autorefs | default(true) %}- autorefs{% endif %}
  {% if enable_section_index | default(true) %}- section-index{% endif %}
  {% if enable_social_cards | default(false) %}- social:
      cards_layout_options:
        background_color: {{ social_cards_background | default('#1976d2') }}
        color: {{ social_cards_color | default('#ffffff') }}{% endif %}
  {% if enable_tags | default(false) %}- tags:
      tags_file: {{ tags_file | default('tags.md') }}{% endif %}
  {% if enable_redirects and redirects %}- redirects:
      redirect_maps:
        {% for old_path, new_path in redirects.items() %}
        {{ old_path }}: {{ new_path }}
        {% endfor %}{% endif %}
  {% if enable_minify | default(false) %}- minify:
      minify_html: true
      minify_css: true
      minify_js: true
      htmlmin_opts:
        remove_comments: true
      cache_safe: true{% endif %}

# Extra configuration for Material
extra:
  generator: 'd361 MkDocs Export System'
  export_date: '{{ export_date }}'
  
  # Material-specific features
  {% if homepage %}homepage: {{ homepage }}{% endif %}
  {% if analytics %}
  analytics:
    provider: {{ analytics.provider | default('google') }}
    property: {{ analytics.property }}
    {% if analytics.feedback %}
    feedback:
      title: Was this page helpful?
      ratings:
        - icon: material/emoticon-happy-outline
          name: This page was helpful
          data: 1
          note: >-
            Thanks for your feedback!
        - icon: material/emoticon-sad-outline
          name: This page could be improved
          data: 0
          note: >-
            Thanks for your feedback! Help us improve this page by
            using our <a href="{{ analytics.feedback_url }}" target="_blank" rel="noopener">feedback form</a>.
    {% endif %}
  {% endif %}
  
  # Social links
  {% if social %}
  social:
    {% for item in social %}
    - icon: {{ item.icon }}
      link: {{ item.link }}
      {% if item.name %}name: {{ item.name }}{% endif %}
    {% endfor %}
  {% endif %}

  # Version information
  {% if version %}
  version:
    provider: {{ version.provider | default('mike') }}
    {% if version.default %}default: {{ version.default }}{% endif %}
    {% if version.alias %}alias: {{ version.alias }}{% endif %}
  {% endif %}

  # Consent for GDPR compliance
  {% if consent | default(false) %}
  consent:
    title: Cookie consent
    description: >- 
      We use cookies to recognize your repeated visits and preferences, as well
      as to measure the effectiveness of our documentation and whether users
      find what they're searching for. With your consent, you're helping us to
      make our documentation better.
  {% endif %}

# Copyright
{% if copyright %}copyright: {{ copyright }}{% endif %}

# Additional CSS/JS
{% if extra_css %}
extra_css:
  {% for css in extra_css %}
  - {{ css }}
  {% endfor %}
{% endif %}

{% if extra_javascript %}
extra_javascript:
  {% if enable_mathjax | default(false) %}
  - javascripts/mathjax.js
  - https://polyfill.io/v3/polyfill.min.js?features=es6
  - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
  {% endif %}
  {% for js in extra_javascript %}
  - {{ js }}
  {% endfor %}
{% endif %}

# Development server configuration
dev_addr: {{ dev_addr | default('127.0.0.1:8000') }}
use_directory_urls: {{ use_directory_urls | default(true) | lower }}
strict: {{ strict_mode | default(false) | lower }}

# Build configuration
{% if edit_uri %}edit_uri: {{ edit_uri }}{% endif %}
{% if edit_uri_template %}edit_uri_template: {{ edit_uri_template }}{% endif %}

# Validation
validation:
  omitted_files: warn
  absolute_links: warn
  unrecognized_links: warn
  anchors: warn
  nav:
    omitted_files: warn
    not_found: warn
    absolute_links: warn