loaders:
  - type: python
processors:
  - type: filter
  - type: smart
  - type: crossref

hooks:
  pre-render:
    - mkdir -p docs/build/content
    - cp -r docs/assets docs/build/content
    - cp docs/CNAME docs/build/content

renderer:
  type: mkdocs
  output_directory: docs/build
  mkdocs_config:
    site_name: Beanie Documentation
    site_url: https://beanie-odm.dev/
    theme:
      name: material
      palette:
        - scheme: default
          primary: white
          toggle:
            icon: material/toggle-switch
            name: Switch to dark mode
        - scheme: slate
          toggle:
            icon: material/toggle-switch-off-outline
            name: Switch to light mode
      logo: assets/logo.svg
      favicon: assets/favicon.png
    extra_css:
      - assets/color_scheme.css
    markdown_extensions:
      - pymdownx.highlight
      - pymdownx.superfences

    repo_url: https://github.com/roman-right/beanie

  markdown:
    use_fixed_header_levels: true
    header_level_by_type:
      Module: 2
      Class: 3
      Method: 4
      Function: 4
      Data: 4
    descriptive_class_title: false
    descriptive_module_title: false
    add_method_class_prefix: true
    add_member_class_prefix: true
    docstrings_as_blockquote: true

  pages:
    - title: Overview
      name: index
      source: docs/index.md
    - title: Getting started
      source: docs/getting-started.md
    - title: Tutorial
      children:
        - title: Defining a document
          source: docs/tutorial/defining-a-document.md
        - title: Initialization
          source: docs/tutorial/init.md
        - title: Inserting into the database
          source: docs/tutorial/insert.md
        - title: Finding documents
          source: docs/tutorial/find.md
        - title: Lazy parsing
          source: docs/tutorial/lazy_parse.md
        - title: Updating & Deleting
          source: docs/tutorial/update.md
        - title: Indexes
          source: docs/tutorial/indexes.md
        - title: Multi-model pattern
          source: docs/tutorial/multi-model.md
        - title: Inheritance
          source: docs/tutorial/inheritance.md
        - title: Aggregation
          source: docs/tutorial/aggregate.md
        - title: Relations
          source: docs/tutorial/relations.md
        - title: Views
          source: docs/tutorial/views.md
        - title: Time Series
          source: docs/tutorial/time_series.md
        - title: Event-based actions
          source: docs/tutorial/actions.md
        - title: Cache
          source: docs/tutorial/cache.md
        - title: Revision
          source: docs/tutorial/revision.md
        - title: State Management
          source: docs/tutorial/state_management.md
        - title: On save validation
          source: docs/tutorial/on_save_validation.md
        - title: Migrations
          source: docs/tutorial/migrations.md
    - title: Batteries
      children:
        - title: Queue
          source: docs/batteries/queue.md
    - title: API Documentation
      children:
        - title: Document
          contents:
            - beanie.odm.documents.*
        - title: Query
          contents:
            - beanie.odm.queries.*
        - title: Interfaces
          contents:
            - beanie.odm.interfaces.*
        - title: Operators
          children:
            - title: Find
              contents:
                - beanie.odm.operators.find.*
            - title: Update
              contents:
                - beanie.odm.operators.update.*
        - title: Fields
          contents:
            - beanie.odm.fields.*
    - title: Development
      source: docs/development.md
    - title: Code of conduct
      source: docs/code-of-conduct.md
    - title: Changelog
      source: docs/changelog.md
